build Error:Could not resolve './use-prevent-globalThis' from ./use-prevent-globalThis?commonjs-external
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.18.0
- Nuxt Version:
3-3.0.0-27235989.d52b1e8
- Package Manager:
Yarn
- Bundler:
Vite
- User Config:
meta
,alias
,css
,vite
- Runtime Modules:
-
- Build Modules:
-
Describe the bug
build error
Could not resolve './use-prevent-globalThis' from ./use-prevent-globalThis?commonjs-external
Reproduction
https://github.com/element-plus/element-plus-nuxt-starter 这个项目在我这边build也报同样错误
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
globalThis - JavaScript - MDN Web Docs
The global globalThis property contains the global this value, which is usually akin to the global object.
Read more >Why can you redefine globalThis and global but not window?
In your case, since globalThis is configurable, you get false (so no error), but as window isn't configurable, HasRestrictedGlobalProperty ...
Read more >Bundling with Rollup - Vue.js 3 Course
commonjs (extension .cjs.js , for use with node.js) ... This would make the user be stuck on the version of Vue we provide...
Read more >A horrifying globalThis polyfill in universal JavaScript
Note that in JavaScript modules, there is a module scope intervening between the global scope and your code. The module scope hides the...
Read more >rollup/plugin-commonjs - npm.io
This can throw at build time if there is no default export. This is how external dependencies are handled when esmExternals is not...
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 FreeTop 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
Top GitHub Comments
Same issue here.
@nachtfunke Yes, exactly. 👍