`import_meta.glob is not a function` (updating `vite@2.3.4` -> `vite@2.3.5`)
See original GitHub issueThe latest release 2.3.5
breaks vite-plugin-ssr
and the browser throws Uncaught TypeError: import_meta.glob is not a function
.
I’m looking at what change may have led to that.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
Features | Vite
Glob Import #. Vite supports importing multiple modules from the file system via the special import.meta.glob function: js
Read more >Vite — Resolve `import.meta.glob` in TypeScript - Future Studio
glob function allowing you to resolve files from a path. In combination with TypeScript, you may have issues that it doesn't pick up...
Read more >webpack热加载优化及vite踩坑记录 - 掘金
3.5 The requested module 'xxx' does not provide an export named 'xx'. exports 改为export ... 3.9 import.meta.glob webpack build 报错.
Read more >vite & react import images dynamically from public url
First you need to adjust the path that you pass to the import.meta.glob function. Specify a path relative to the file that this...
Read more >Glob Imports in Vite - A Vue.js Lesson From our Vue.js Course:...
In this lesson, we learn how to import multiple modules at one time using a glob pattern. Matched modules can be imported either...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🤔 It’s still the
tsconfig.json
issue.esbuild
uses its target to transpile.js
files too. I think I need to file an issue to esbuild. This will cause much confusion.As a workaround, you can add
tsconfig.json
to.npmignore
to avoid it being published on npm; or better, use thefiles
field inpackage.json
to only publish the necessary files.The client is not transpiled to CommonJS. If you look at
node_modules/.vite/vite-plugin-ssr_client.js
(after running the reproduction steps) you’ll see ES Modules, as expected.By a matter of fact this is a bug and regression, since everything works with
vite@2.3.4
. Not sure if it only affectsvite-plugin-ssr
butimport.meta.glob
is not being processed as it should.