Replies: 3 comments
-
Vite dev SSR's external concept might feel odd, but indeed it rewrites externalized node modules import.
(Oh, actually this custom |
Beta Was this translation helpful? Give feedback.
-
@hi-ogawa Here are the details:
Behavior:
Confusion:This behavior is unexpected because I have explicitly marked the module as external in vite.config.js#L7. My expectation is that the module would be imported as is, without any issues. But Vite is trying import himself In my situation I have many mini SPA application which load on demand. it's like microfrontend. The url depend on environment, so I cant use absolute url. |
Beta Was this translation helpful? Give feedback.
-
Hm, I am wondering if my issue is related to this one. #19865 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can someone explain this behavior?
I added a module to ssr-external and expected Vite not to process these modules in any way. However, Vite still attempts to load this module. The check for external dependencies seems quite strange.
I am marking these modules as external with the assumption that Vite will not interfere with them. For example, I use module.register to emulate importmap.
In latest version of Vite the condition of external deps is the same.
Why does Vite try to load a module that is specified as an external dependency?
Beta Was this translation helpful? Give feedback.
All reactions