You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Vite project that must pull together code from several entry scripts into one entry chunk, and are using rollup-plugin-multi-entry to achieve this. That in turn uses rollup-plugin-virtual.
Note how one is prefixed with only virtual and one with \u000virtual. This is strange, but in production, it works.
When running the dev server, however, it fails to resolve /static/virtual:aleksis-local-full.js and throws a 404 error.
My current guess is that rollup-plugin-virtual always expects the \0virtual prefix including the NULL byte, and thus, in the dev server, resolving the bundle name without the NULL byte fails. So the issue here would be that some code parts include the NULL byte and some don't.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
We have a Vite project that must pull together code from several entry scripts into one entry chunk, and are using
rollup-plugin-multi-entry
to achieve this. That in turn usesrollup-plugin-virtual
.Vite config:
Now, when building for production, this generates the following manifest snippet:
Note how one is prefixed with only
virtual
and one with\u000virtual
. This is strange, but in production, it works.When running the dev server, however, it fails to resolve
/static/virtual:aleksis-local-full.js
and throws a 404 error.My current guess is that
rollup-plugin-virtual
always expects the\0virtual
prefix including the NULL byte, and thus, in the dev server, resolving the bundle name without the NULL byte fails. So the issue here would be that some code parts include the NULL byte and some don't.Reproduction
https://github.com/Natureshadow/vite-multi-mwe
Steps to reproduce
Run
npm install
andnpm run dev
, then try to accesshttp://localhost:5173/virtual:multi-entry.js
.System Info
System: OS: Linux 6.0 Debian GNU/Linux bookworm/sid CPU: (8) x64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz Memory: 8.85 GB / 15.26 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 18.12.1 - /usr/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.2.0 - /usr/bin/npm Browsers: Chromium: 108.0.5359.124 Firefox: 108.0 npmPackages: vite: ^4.0.0 => 4.0.2
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: