We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c7deef commit aff8225Copy full SHA for aff8225
next.config.mjs
@@ -8,8 +8,15 @@ const nextConfig = {
8
images: {
9
unoptimized: true,
10
},
11
- webpack: function (config, options) {
12
- config.options = { ...options, asyncWebAssembly: true }
+ webpack(config, { isServer, dev }) {
+ // Use the client static directory in the server bundle and prod mode
13
+ // Fixes `Error occurred prerendering page "/"`
14
+ config.output.webassemblyModuleFilename =
15
+ isServer && !dev ? '../public/onigasm.wasm' : 'public/onigasm.wasm'
16
+
17
+ // Since Webpack 5 doesn't enable WebAssembly by default, we should do it manually
18
+ config.experiments = { ...config.experiments, asyncWebAssembly: true }
19
20
return config
21
22
experimental: {
0 commit comments