question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import wasm bug when running on production (nuxt preview)

See original GitHub issue

Environment


  • 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
image

Additional context

Thanks for any help!

Logs

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danielroecommented, Sep 19, 2022

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 in package.json) to reproduce within stackblitz alone in future issues.

0reactions
manniLcommented, Nov 2, 2022

@danielroe Thank you for considering this issue. In my opinion this is not a minor bug because it means that as long as this one is not fixed .wasm packages cannot be used with Nuxt 3 but I trust in your evaluation. Thank you!

Please be aware that this categorization follows a flow chart. See the docs for more

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found