Open satelllte opened 5 months ago
@isaac-mason is this some kind of WASM/Next.js issue?
Hi 👋🏻
This issue likely stems from how Next.js handles module resolution for WebAssembly files. To fix it, try adding the following to your next.config.js
:
const nextConfig = {
webpack: (config, { isServer }) => {
if (!isServer) {
config.experiments = { asyncWebAssembly: true };
}
return config;
},
};
module.exports = nextConfig;
Ensure all dependencies are correctly installed:
npm install @react-three/jolt
If the issue persists, check the https://nextjs.org/docs/messages/module-not-found for further guidance.
Have you encountered this issue before or found a solution that works? Any additional details could help narrow down the problem.
Hi @r00ott 👋🏻 I haven't found any solution yet and I encountered this issue every time I tried to use Jolt with Next.js.
I've created a quick repo with jolt
branch which reproduces it:
https://github.com/satelllte/react-three-next-jolt/pull/1
Tried to install Jolt and set asyncWebAssembly
, now it fails with the same error if I'm trying to do npm run build
, but if I try to run it in development via npm run dev
, the dev server gets stuck with Compiling / ...
message for ever, unfortunately.
Hi 👋🏻 The lib fails in Next.js with the following error on any import from
@react-three/jolt
:Example:
Have you ever experienced such issue?