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
Hello, I have an npm library called platform. In this library, I have route structures and menus that I designed with my material UI library https://github.com/322332/platform. I want to install and use this library in other projects with npm, but when I add some material UI components, I get errors like ncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=cf7fa801' does not provide an export named 'default' (at elementAcceptingRef.js?v=cf7fa801:1:8)
This error only comes in npm run dev.
npm run build and later
If I do npm run preview, I can build and use it without any problems.
322332
changed the title
GET http://localhost:5173/node_modules/@mui/icons-material/esm/AdUnits.js?v=b26365ed net::ERR_BLOCKED_BY_CLIENT
Uncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=cf7fa801' does not provide an export named 'default
Nov 1, 2023
Seems like vitejs/vite#3910. Not a dedupe issue exactly, but the same cause where the library publishes raw JSX files, Vite tells esbuild to externalize them, and consequently the JSX file that imports @mui/icons-material never got optimized together.
I'm not really sure if this is a common setup though. And usually you'd compile the JSX to JS before publishing the library.
Ok thanks, closing here as this might be a missing feature in core and not a bug in this plugin.
While publishing jsx/ts/tsx is allowed for use in internal libs, we don't ensure that you get all the features and this should be used only for people that knows the trade-off of publishing non standard JS files.
Just in case: The pattern of UI lib imported by multiple apps works very well in Vite with a mono-repo setup, you will even get HMR for the UI components!
Describe the bug
Hello, I have an npm library called platform. In this library, I have route structures and menus that I designed with my material UI library https://github.com/322332/platform. I want to install and use this library in other projects with npm, but when I add some material UI components, I get errors like ncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=cf7fa801' does not provide an export named 'default' (at elementAcceptingRef.js?v=cf7fa801:1:8)
This error only comes in npm run dev.
npm run build and later
If I do npm run preview, I can build and use it without any problems.
npm package and github repo
https://github.com/322332/platform
https://www.npmjs.com/package/nuc-platform-vite
Reproduction
https://codesandbox.io/p/github/322332/platform-tester/main?import=true&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clod2c9s20007356iru9eywmx%2522%252C%2522sizes%2522%253A%255B62.414664981036665%252C37.585335018963335%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clod2c9s20003356iyyyeyxgp%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clod2c9s20005356idzbjdcls%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clod2c9s20006356ipfr6a24l%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B60%252C40%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clod2c9s20003356iyyyeyxgp%2522%253A%257B%2522id%2522%253A%2522clod2c9s20003356iyyyeyxgp%2522%252C%2522activeTabId%2522%253A%2522clod2l8o401ck356idvx7ra7m%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clod2c9s10002356ivvce2k3r%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252F.gitignore%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%252C%257B%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Fapp.jsx%2522%252C%2522id%2522%253A%2522clod2l8o401ck356idvx7ra7m%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%252C%257B%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Fmain.jsx%2522%252C%2522id%2522%253A%2522clofxkb0o00vi356iy76oxlab%2522%252C%2522mode%2522%253A%2522temporary%2522%257D%255D%257D%252C%2522clod2c9s20006356ipfr6a24l%2522%253A%257B%2522id%2522%253A%2522clod2c9s20006356ipfr6a24l%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A5173%252C%2522id%2522%253A%2522clod4gbj100fv356iygjzyfd1%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clod4gbj100fv356iygjzyfd1%2522%257D%252C%2522clod2c9s20005356idzbjdcls%2522%253A%257B%2522id%2522%253A%2522clod2c9s20005356idzbjdcls%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522id%2522%253A%2522clod48a1t0050356ir73zuqml%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clod48a1t0050356ir73zuqml%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
vite
Validations
The text was updated successfully, but these errors were encountered: