Matthew Smithburger
10/20/2021, 2:24 AMyarn build  in the directory, only when I run sst deploy.
ModuleNotFoundError: Module not found: Error: Can't resolve 'electron' in '/Users/matt.smithburger/Projects/mintopoly/server/node_modules/swarm-js/node_modules/got'
> Build error occurred
Error: > Build failed because of webpack errors
    at /Users/matt.smithburger/Projects/mintopoly/server/node_modules/next/dist/build/index.js:397:19
    at async Span.traceAsyncFn (/Users/matt.smithburger/Projects/mintopoly/server/node_modules/next/dist/telemetry/trace/trace.js:60:20)
    at async Object.build [as default] (/Users/matt.smithburger/Projects/mintopoly/server/node_modules/next/dist/build/index.js:77:25)
Error: There was a problem building the "Site" NextjsSite.
    at NextjsSite.buildApp (/Users/matt.smithburger/Projects/mintopoly/server/node_modules/@serverless-stack/resources/src/NextjsSite.ts:545:13)
    at new NextjsSite (/Users/matt.smithburger/Projects/mintopoly/server/node_modules/@serverless-stack/resources/src/NextjsSite.ts:103:16)
    at new UIStack (/Users/matt.smithburger/Projects/mintopoly/server/lib/UI.ts:11:18)
    at Object.main (/Users/matt.smithburger/Projects/mintopoly/server/lib/index.ts:30:3)
    at Object.<anonymous> (/Users/matt.smithburger/Projects/mintopoly/server/.build/run.js:93:16)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
There was an error synthesizing your app.Frank
Frank
node_modules/nextjs-lambda/dist/build.js, if you look for subprocess, you should see something like this:
const subprocess = (0, execa_1.default)(cmd, args, {
    cwd,
    env
});
If you print out cmd, args, cwd, and env, that can give us some idea of what command was actually ran in which working directory. And we can try running the command manually in the terminal.Frank
Matthew Smithburger
10/20/2021, 3:05 AM"./node_modules/.bin/next"
[
  "build"
]
"/Users/matt.smithburger/Projects/mintopoly/server/frontend"
{}Matthew Smithburger
10/20/2021, 3:17 AMMatthew Smithburger
10/20/2021, 3:21 AM./node_modules/.bin/next build inside the frontend directory and it seems to buildFrank
Frank
getStaticProps in frontend/pages/index.js
• setup electron and web3
• run sst build and see if you can reproduce the issueFrank