Skip to content

Conversation

@klaftertief
Copy link
Contributor

The existing implementation assumed a stable order in the importTree, which is not given. Sometimes the importer that was used contained a query param ? in the id, which prevented this.resolve() from resolving correctly, leading to an error such the following. We combine multiple Elm apps into on big bundle to share the same Elm runtime.

[vite-plugin-elm] Could not load /home/runner/work/repo/src/elm/Apps.elm?with=@app/elm/App1.elm&with=@app/elm/App2.elm&with=@app/elm/App3.elm (imported by ../../src/js/elm-apps.js): ENOENT: no such file or directory, open '@app/elm/App1.elm'

The existing logic had a flaw.
It assumed and stable order in the `importTree`, which was not given.
Sometimes the `importer` that was used contained a query param `?` in the id, which prevented `this.resolve()` from resolving correctly.
@klaftertief
Copy link
Contributor Author

Ok, need to look at the failing test...

@klaftertief
Copy link
Contributor Author

klaftertief commented Sep 5, 2025

The implementation work with the resolve.alias config.

@hmsk I can run the cypress tests locally, but changes in the plugin implementation are not picked up. Do you have any tips how to run the cypress test locally? I am running npm run cypress:prepare in one terminal, npm run cypress:open in another one. But code changes are not picked up then.
I was confused but the import { console } from 'inspector', which prevented my poor man's debugging from working.
I am stupid, the import was added automatically by some to intelligent tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant