-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[vite/plugin] The "attributes" property of ModuleInfo is not supported. #15411
Comments
Start a new pull request in StackBlitz Codeflow. |
This is breaking rollup-plugin-import-css-classes when running on Vite. |
I created a package which currently supports only webpack but I would love to add support for Vite too. Unfortunately I get
The information I need is available but only behind a private api ( With Webpack it is possible during dev and build https://webpack.js.org/api/loaders/#thisloadmodule to access the Is there anything I can do to support adding this feature? |
It appears that the return value of In serve mode, the vite/packages/vite/src/node/server/pluginContainer.ts Lines 200 to 201 in b240a83
While we can manually obtain a In build mode, everything just works as expected. |
Describe the bug
When using
this.getModuleInfo(id).attributes
in a plugin (for instance intransform
hook) the following error occurs :But the same code works in native Rollup plugins.
related issue: Support for moduleInfo.meta in resolveId hook still not equivalent in vite dev and vite build
Reproduction
https://stackblitz.com/edit/vitejs-vite-5et2xu?file=vite.config.js&terminal=dev
System Info
Used Package Manager
npm
Logs
Click to expand!
10:46:44 PM [vite] Internal server error: [vite] The "attributes" property of ModuleInfo is not supported.
Validations
The text was updated successfully, but these errors were encountered: