Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm loader does not load from node_modules #269

Closed
farnabaz opened this issue Oct 7, 2021 · 2 comments · Fixed by nuxt/framework#698
Closed

Wasm loader does not load from node_modules #269

farnabaz opened this issue Oct 7, 2021 · 2 comments · Fixed by nuxt/framework#698
Labels
bridge bug Something isn't working

Comments

@farnabaz
Copy link
Member

farnabaz commented Oct 7, 2021

Seems that wasm loader does not load files from node_modules.

 WARN  [worker] Unknown file extension ".wasm" for ***/node_modules/shiki/dist/onigasm.wasm

  at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:71:15)
  at Loader.getFormat (internal/modules/esm/loader.js:102:42)
  at Loader.getModuleJob (internal/modules/esm/loader.js:231:31)
  at async ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:58:21)
  at async Promise.all (index 9)
  at async link (internal/modules/esm/module_job.js:63:9)

While when I copy the wasm file to server/api directory and use relative path it works as expected

import onigasm from './onigasm.wasm' // works
import onigasm from 'shiki/dist/onigasm.wasm' // Don't work

related to nuxt/framework#693
reproduction: https://github.com/farnabaz/nuxt-shiki

@farnabaz farnabaz added bug Something isn't working bridge labels Oct 7, 2021
Copy link
Member

@farnabaz What happens when you add the module to your build.transpile array?

Copy link
Member Author

farnabaz commented Oct 7, 2021

@danielroe It raise same error

@danielroe danielroe transferred this issue from nuxt/framework Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants