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
Currently if you have ssr.noExternal: true and generate an ssr esm bundle you will get the error require is not defined when trying to run the bundle with Node at runtime if you use commonjs packages.
In my opinion Vite should add the same createRequire banner it adds during optimization:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently if you have
ssr.noExternal: true
and generate an ssr esm bundle you will get the errorrequire is not defined
when trying to run the bundle with Node at runtime if you use commonjs packages.In my opinion Vite should add the same createRequire banner it adds during optimization:
vite/packages/vite/src/node/optimizer/index.ts
Line 792 in 22b2994
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions