Xero
Xero7mo ago

Next JS Module With wasm File and Module Not Found Error

I'm trying to run code from an npm library called opencascade. I installed it using npm install opencascade.js@beta When trying to run it I get a weird error
./node_modules/opencascade.js/dist/opencascade.full.wasm
Module not found: Can't resolve 'a'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/opencascade.js/dist/index.js
./components/configurator.tsx
./components/hybrid-viewer.tsx
./pages/index.tsx
./node_modules/opencascade.js/dist/opencascade.full.wasm
Module not found: Can't resolve 'a'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/opencascade.js/dist/index.js
./components/configurator.tsx
./components/hybrid-viewer.tsx
./pages/index.tsx
This seems to have something to do with a .wasm file in the node-modules. I haven't before used a .wasm file. The same module loads and works alright in a normal react application which is not a next js application
0 Replies
No replies yetBe the first to reply to this messageJoin