From 9b9670adea7106bbe56a0adc3aef313549d28b92 Mon Sep 17 00:00:00 2001 From: anarkrypto Date: Tue, 3 Sep 2024 21:58:19 -0300 Subject: [PATCH] fix: Support o1js WASM in server side marking it a external dependency --- apps/web/next.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 555890c..bd4b01a 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -14,7 +14,7 @@ const nextConfig = { }, ]; }, - webpack(config) { + webpack(config, { isServer }) { config.experiments = { ...config.experiments, topLevelAwait: true }; config.resolve.fallback = { fs: false, @@ -37,6 +37,10 @@ const nextConfig = { }), ); + if (isServer) { + config.externals.push('o1js'); + } + return config; }, compress: false,