I'm trying to migrate my site to mdx2 and mdx-embed.
I'm running into issues with webpack not recognizing my web-assembly configuration in next.config.mjs
. The issue is happening during the import of wasm file during the "yarn build".
Import trace for requested module:
./wasm/fulltext-search/pkg/fulltext_search_core.js
./components/Search/Search.tsx
./components/Search/index.tsx
./pages/articles/index.tsx
Here is my migration branch below:
https://github.com/hanymorcos/hanymorcos.github.io/tree/next_config_mjs_mdx2
info - Creating an optimized production build
Failed to compile.
./wasm/fulltext-search/pkg/fulltext_search_core_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)