Import wasm bug when running on production (nuxt preview)
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v18.9.0
- Nuxt Version:
3.0.0-rc.10
- Nitro Version:
0.5.3
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-2ebtve-l73ttp?file=nuxt.config.ts
I cannot reproduce it on stackblitz because Nuxt is not running in production there. That’s why I’ve created a repository with a minimal example of the problem here https://github.com/bitlands/wasm-import
Describe the bug
This bug is a follow up thing of https://github.com/nuxt/framework/issues/6703. When I run yarn dev
everything works fine and the library can be loaded but when I run yarn run build
& yarn run preview
the following error appears when I go to the browser console at localhost:3000
.
Uncaught (in promise) CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
Additional context
Thanks for any help!
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Nux3 3.0.0-rc.2 met Warning: To load an ES module, set "type ...
nuxt preview Nuxt CLI v3.0.0-rc.3 23:26:20 i Node.js version: 14.17.3 ... This will not be loaded when running the server in production.
Read more >nuxt.js - Not able to preview NuxtJs3 build - Stack Overflow
My Nuxt 3 Project is suddenly giving me some error after release of 3.0.0-rc.5, it used to work well and now i am...
Read more >Getting Started - ESBuild
Getting Started. #Install esbuild. First, download and install the esbuild command locally. A prebuilt native executable can be installed using npm (which ...
Read more >equire is not defined in es module scope, you can use import ...
Server Error Error: Must use import to load ES Module: C:\Users\bucsa\dev\atomic\node_modules\konva\lib\Core.js require() of ES modules is not supported.
Read more >Preview Mode - Nuxt
Live Preview for target static with the preview mode. ... are handled client-side and thus the plugin should be run on the client:...
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
FYI, you can hit Ctrl-C to stop the dev server in stackblitz and then run
npm run build && node .output/server/index.mjs
(or hard-code that as the dev command inpackage.json
) to reproduce within stackblitz alone in future issues.Please be aware that this categorization follows a flow chart. See the docs for more