Closed jafin closed 10 months ago
It's a vite bug. There was a huge refactor of the module resolution logic in 4.3
@aleclarson is there a corresponding issue in the Vite repo already? If not how can we help?
Edit: from debugging, it looks like the issue is that resolveId()
is called with a value for importer
that isn't a fully resolved ID anymore, breaking the Rollup plugin API contract?
Has the bug been solved now? There's a reference to this thread in the vite repo with a PR that's merged. But I'm still having the same issue.
Lots of finger pointing here, no real path to resolution. We reverted to 4.2.2 and our CIDC pipeline works now. Weird though that 4.5.0 works fine locally, but not in the cidc. This plugin only fails in our cidc pipeline, same OS, same Node, Same yarn version, same environment variables, it fails on cidc in azure, but locally on windows in the same setup it works...
But if we revert to 4.2.2 it works in azure on our build agent.
Weird. I can't explain why it works locally, but not in the build agent...
Lots of finger pointing here, no real path to resolution. We reverted to 4.2.2 and our CIDC pipeline works now. Weird though that 4.5.0 works fine locally, but not in the cidc. This plugin only fails in our cidc pipeline, same OS, same Node, Same yarn version, same environment variables, it fails on cidc in azure, but locally on windows in the same setup it works...
But if we revert to 4.2.2 it works in azure on our build agent.
Weird. I can't explain why it works locally, but not in the build agent...
@rtmann Did you eventually find out why? I ran into the same issue but with Vite 5. Things worked on Mac and Linux, but on Windows, when running using VS Code Extension Host (which is Node 18), I got the above error 🫤
It was even more strange that things worked the first time I started the development server (using createServer
, the JavaScript API, not Vite CLI). Then I stopped the server, and things went wrong from the second start. When using build
, things went wrong from the first. So I guess "reusing" Vite for multiple jobs was not an issue here.
I have a project that was running Vite 4.2.2, upgraded to Vite@4.3.1 Now when I run it appears the tsconfig aliases no longer work.
If I revert to Vite 4.2.2 it all works again.
my tsconfig.paths.json looks like this
TBH Not sure if this is related to this plugin or vite 4.3x in general...