Davide Ungari
12/26/2021, 10:10 PMBuilding Next.js site frontend
Error: There was a problem building the "site" NextjsSite.
at NextjsSite.buildApp (/tmp/seed/source/node_modules/@serverless-stack/resources/src/NextjsSite.ts:607:13)
at new NextjsSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/NextjsSite.ts:148:16)
at new MainStack (/tmp/seed/source/stacks/MainStack.ts:21:18)
at Object.main (/tmp/seed/source/stacks/index.ts:5:3)
at Object.<anonymous> (/tmp/seed/source/.build/run.js:94:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Error: Subprocess exited with error 1
at ChildProcess.<anonymous> (/tmp/seed/source/node_modules/aws-cdk/lib/api/cxapp/exec.ts:127:23)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:467:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
There was an error synthesizing your app.
Any idea how to debug what is going on?Devin
12/26/2021, 10:12 PMDavide Ungari
12/26/2021, 10:13 PMDavide Ungari
12/26/2021, 10:19 PMDavide Ungari
12/26/2021, 10:20 PMDevin
12/26/2021, 10:21 PMDavide Ungari
12/26/2021, 10:21 PMDavide Ungari
12/26/2021, 10:22 PMDevin
12/26/2021, 10:23 PMDavide Ungari
12/26/2021, 10:26 PMDavide Ungari
12/26/2021, 10:27 PMDavide Ungari
12/26/2021, 10:29 PMFrank
sst build
command locally and see if it work?Derek Kershner
12/27/2021, 10:42 PM.env
file locally that the CI/CD doesnt?Davide Ungari
12/28/2021, 7:54 AMDavide Ungari
12/28/2021, 8:52 AMDavide Ungari
12/28/2021, 8:53 AMDavide Ungari
12/28/2021, 8:53 AMDavide Ungari
12/28/2021, 8:54 AMJonathan Farmand
12/28/2021, 8:05 PMDerek Kershner
12/28/2021, 8:57 PM.js
file amongst the TS ones.Davide Ungari
12/28/2021, 10:03 PM# typescript
*.js
*.d.ts
Davide Ungari
12/28/2021, 10:03 PMJonathan Farmand
12/28/2021, 10:05 PMJonathan Farmand
12/28/2021, 10:07 PMDavide Ungari
12/28/2021, 10:08 PMDavide Ungari
12/28/2021, 10:23 PMDavide Ungari
12/28/2021, 10:23 PMDavide Ungari
12/28/2021, 10:46 PMJonathan Farmand
12/28/2021, 10:49 PMJonathan Farmand
12/28/2021, 10:53 PM[dotenv][DEBUG] did not match key and value when parsing line 1: # These variables are only available in your SST code.
[dotenv][DEBUG] did not match key and value when parsing line 2: # To apply them to your Lambda functions, checkout this doc - <https://docs.serverless-stack.com/environment-variables#environment-variables-in-lambda-functions>
[dotenv][DEBUG] did not match key and value when parsing line 3:
Building Next.js site frontend
Error: There was a problem building the "Site" NextjsSite.
at NextjsSite.buildApp (/tmp/seed/source/node_modules/@serverless-stack/resources/src/NextjsSite.ts:607:13)
at new NextjsSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/NextjsSite.ts:148:16)
at new FrontendStack (/tmp/seed/source/stacks/FrontendStack.js:9:18)
at Object.main (/tmp/seed/source/stacks/index.js:17:3)
at Object.<anonymous> (/tmp/seed/source/.build/run.js:94:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Error: Subprocess exited with error 1
at ChildProcess.<anonymous> (/tmp/seed/source/node_modules/aws-cdk/lib/api/cxapp/exec.ts:127:23)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:467:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
There was an error synthesizing your app.
ERROR: Error: Subprocess exited with error 1
Davide Ungari
12/28/2021, 11:50 PMnpm install
npx sst build --stage develop --region eu-west-1 --verbose
from the root I can reproduce the errorDavide Ungari
12/28/2021, 11:51 PMfrontend
folder and do an npm install
then it worksDavide Ungari
12/29/2021, 12:04 AMError: Command failed: node /home/davideu/Workspace/3prawns/webapp/node_modules/@serverless-stack/resources/assets/NextjsSite/build.js --path /home/davideu/Workspace/3prawns/webapp/frontend --output /home/davideu/Workspace/3prawns/webapp/.build/frontend-1640736230330 --config eyJjd2QiOiIvaG9tZS9kYXZpZGV1L1dvcmtzcGFjZS8zcHJhd25zL3dlYmFwcC9mcm9udGVuZCIsImFyZ3MiOlsiYnVpbGQiXX0=
at checkExecSyncError (child_process.js:643:11)
at execSync (child_process.js:679:15)
at NextjsSite.buildApp (/home/davideu/Workspace/3prawns/webapp/node_modules/@serverless-stack/resources/src/NextjsSite.ts:598:15)
at new NextjsSite (/home/davideu/Workspace/3prawns/webapp/node_modules/@serverless-stack/resources/src/NextjsSite.ts:148:16)
at new MainStack (/home/davideu/Workspace/3prawns/webapp/stacks/MainStack.ts:21:18)
at Object.main (/home/davideu/Workspace/3prawns/webapp/stacks/index.ts:5:3)
at Object.<anonymous> (/home/davideu/Workspace/3prawns/webapp/.build/run.js:94:16)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 816609,
stdout: null,
stderr: null
}
Davide Ungari
12/29/2021, 12:08 AMError building site: Error: Command failed with ENOENT: ./node_modules/.bin/next build
spawn ./node_modules/.bin/next ENOENT
Jonathan Farmand
12/29/2021, 12:09 AMDavide Ungari
12/29/2021, 12:18 AMnpx sst build
to take care of it... locally was working just because I did it manually or something like that at a certain point.Jonathan Farmand
12/29/2021, 12:20 AM