-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev server fails to load the scripts with 404 when using Vite base
option and virtual modules
#15873
Comments
Start a new pull request in StackBlitz Codeflow. |
Vite responding I guess instead of |
@sapphi-red, I think one option is to handle this in the plugin; this was my initial approach to solving this, and I got it working this way. However, I was wondering, since:
Perhaps, instead of overriding in the plugin, it would make sense to handle this in the DevServer's base.ts as part of the change introduced by #5657, to cater to virtual modules? LMKYT PS: I've edited the description to refer to #5657. This was the actual change I meant to refer to but I linked it to wrong number. |
I think whether we can consider adding the
|
I see. @XiSenao I think that makes sense. Would you create a PR? |
Of course. However, before that, @renataogarcia has already tried to explore this issue. Are you willing to solve this issue? @renataogarcia |
@XiSenao Yep, I'm happy to have look and create a PR. |
Describe the bug
After upgrading to 5, vite-plugin-virtual-mpa Dev server fails to load the scripts with 404 when using Vite
base
option.The plugin generates virtual modules, and due #5657 it now failing as reported here in more detail.
Essentially it fails because virtual modules start with '/@id/x00/<base>' instead of '<base>' as #5657 now requires.
Should the middleware also handle the virtual modules here?
Reproduction
https://stackblitz.com/edit/vitejs-vite-zr5nzg?file=.vscode%2Fsettings.json
Steps to reproduce
Once the project starts:
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.18.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.14.0 - /usr/local/bin/pnpm npmPackages: vite: ^5.1.0 => 5.1.1 vite-plugin-virtual-mpa@1.10.0
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: