Open
Description
Describe the bug
Plugins that try to feature detect anything on ModuleInfo
, for example import attributes: https://github.com/jleeson/rollup-plugin-import-css/blob/master/src/index.js#L80, will cause vite to throw an internal server error:
This behavior breaks certain plugins that otherwise would work fine. I've checked by manually removing line 80 in the plugin link above. After that, vite + plugin work fine.
Reproduction
https://github.com/jpzwarte/vite-module-info-internal-server-error
Steps to reproduce
npm ci
vite dev
System Info
System:
OS: macOS 15.5
CPU: (16) arm64 Apple M4 Max
Memory: 3.40 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.16.0 - /opt/homebrew/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.9.2 - /opt/homebrew/bin/npm
pnpm: 9.15.4 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 137.0.7151.120
Safari: 18.5
Safari Technology Preview: 26.0
npmPackages:
vite: ^6.3.5 => 6.3.5
Used Package Manager
npm
Logs
Click to expand!
❯ vite dev
VITE v6.3.5 ready in 292 ms
➜ Local: http://127.0.0.1:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
1:49:22 PM [vite] (client) Pre-transform error: [vite] The "assertions" property of ModuleInfo is not supported.
Plugin: import-css
File: /Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/src/main.css
1:49:22 PM [vite] Internal server error: [vite] The "assertions" property of ModuleInfo is not supported.
Plugin: import-css
File: /Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/src/main.css
at Object.get (file:///Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:42102:19)
at TransformPluginContext.transform (file:///Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/node_modules/rollup-plugin-import-css/dist/plugin.js:43:37)
at async EnvironmentPluginContainer.transform (file:///Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:42294:18)
at async loadAndTransform (file:///Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:35735:27)
at async viteTransformMiddleware (file:///Users/jeroen.zwartepoorte/Projects/vite-module-info-internal-server-error/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:37250:24)
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.