<p>I am trying to set up Mesh library on an existing NextJS project. I am not sure how to handle an issue that seems to be with the Webpack configuration for handling wasm files in the library. I am adding the library and configuration using the guide provided <a href="https://meshjs.dev/guides/nextjs" rel="nofollow noreferrer">here</a> by Mesh.dev.</p>
<p>The error after starting the NextJS project server is:</p>
<pre><code>
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./node_modules/@emurgo/cardano-message-signing-browser/cardano_message_signing_bg.wasm
Module parse failed: Unexpected character '' (1:0)
The module seem to be a WebAssembly module, but module is not flagged as WebAssembly module for webpack.
BREAKING CHANGE: Since webpack 5 WebAssembly is not enabled by default and flagged as experimental feature.
You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true' (based on async modules) or 'experiments.syncWebAssembly: true' (like webpack 4, deprecated).
For files that transpile to WebAssembly, make sure to set the module type in the 'module.rules' section of the config (e. g. 'type: &quot;webassembly/async&quot;').
(Source code omitted for this binary file)

Import trace for requested module:
./node_modules/@emurgo/cardano-message-signing-browser/cardano_message_signing_bg.wasm
./node_modules/@emurgo/cardano-message-signing-browser/cardano_message_signing.js
./node_modules/@meshsdk/core/dist/core.js
./node_modules/@meshsdk/react/dist/react.js

</code></pre>

CC BY-SA 4.0
2023-01-14T16:19:22.640Z
Hi, please read the error message and read the guides. The error says, You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true'. And the guide you have pointed out shows exactly the config you need.
Jingles
CC BY-SA 4.0
2023-01-16T05:57:02.587Z
Thanks @Jingles I had mistyped the name of the config file. Solved!
Skelli
<wallet><mesh>
How do I resolve this Webpack issue with Mesh library on NextJS project
# How do I resolve this Webpack issue with Mesh library on NextJS project

(Asked by: username_0 on 2023-01-14)

I am trying to set up Mesh library on an existing NextJS project. I am not sure how to handle an issue that seems to be with the Webpack configuration for handling wasm files in the library. I am adding the library and configuration using the guide provided here by Mesh.dev.
The error after starting the NextJS project server is:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./node_modules/@emurgo/cardano-message-signing-browser/cardano_message_signing_bg.wasm
Module parse failed: Unexpected character '' (1:0)
The module seem to be a WebAssembly module, but module is not flagged as WebAssembly module for webpack.
BREAKING CHANGE: Since webpack 5 WebAssembly is not enabled by default and flagged as experimental feature.
You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true' (based on async modules) or 'experiments.syncWebAssembly: true' (like webpack 4, deprecated).
For files that transpile to WebAssembly, make sure to set the module type in the 'module.rules' section of the config (e. g. 'type: "webassembly/async"').
(Source code omitted for this binary file)

Import trace for requested module:
./node_modules/@emurgo/cardano-message-signing-browser/cardano_message_signing_bg.wasm
./node_modules/@emurgo/cardano-message-signing-browser/cardano_message_signing.js
./node_modules/@meshsdk/core/dist/core.js
./node_modules/@meshsdk/react/dist/react.js

**Tags:** wallet, mesh
> **Comments:**
> **username_1**: Hi, please read the error message and read the guides. The error says, You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true'. And the guide you have pointed out shows exactly the config you need.  
> **username_0**: Thanks @Jingles I had mistyped the name of the config file. Solved!  

---

## 0 answers

