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
instantiateModule in ssrModuleLoader.ts tries to load a library that I'm working on, and it fails. That error happens lots of times across many files in the library.
The library works fine with vite when it's not SSR. It's failing only with SSR.
5:15:47 PM [vite] Error when evaluating SSR module /node_modules/vue-instantsearch/dist/vue3/es/src/components/InstantSearchSsr.js:
ReferenceError: e is not defined
at Module.s (../../../../../src/util/createInstantSearchComponent.js:80:4)
at ../../../../../src/components/InstantSearchSsr.js:9:8
at instantiateModule (/Users/eunjaelee/sandbox/vue3-ssr-vis/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:68693:166)
I'm not so sure but from my observation, let's say we have this:
So, why does it say ReferenceError: e is not defined? I don't know, but I see the e in createInstantSearchComponent.js and polyfills.js.
I renamed the function e in polyfills.js, so that
functione1(e){
...
}export{e1as_objectSpread};
Then I ran rm -rf node_modules/.vite && yarn dev, and it no longer gives me the error. It still gives me the similar errors but in other files. I kept renaming stuff like this, and finally got it working with no errors.
I don't know why this same name across different files make this errors.
Before submitting the issue, please make sure you do the following
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Provide a description in this issue that describes the bug.
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 https://github.com/vuejs/vue-next instead.
Describe the bug
instantiateModule
in ssrModuleLoader.ts tries to load a library that I'm working on, and it fails. That error happens lots of times across many files in the library.The library works fine with vite when it's not SSR. It's failing only with SSR.
I'm not so sure but from my observation, let's say we have this:
and
When
a.js
is importingb.js
and two files both have something callede
, then it fails.Reproduction
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: reproduced in both [email protected] and [email protected]
Logs
What I tried with this log is,
InstantSearchSsr.js
is being loaded and it seems to be failed while it was importing its dependencycreateInstantSearchComponent.js
node_modules/....
path.InstantSearchSsr.js
looks like this:createInstantSearchComponent.js
looks like this:polyfills.js
looks like this:So, why does it say
ReferenceError: e is not defined
? I don't know, but I see thee
increateInstantSearchComponent.js
andpolyfills.js
.I renamed the function
e
inpolyfills.js
, so thatThen I ran
rm -rf node_modules/.vite && yarn dev
, and it no longer gives me the error. It still gives me the similar errors but in other files. I kept renaming stuff like this, and finally got it working with no errors.I don't know why this same name across different files make this errors.
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: