Hi folks,
I'm struggling with building pipeline for 2 days, so I really need your help this stage.
I've gotten a project which is written in Next.js, and I need to make a pipeline to deploy the project to AWS Beanstalk.
This is my pipeline below.
```
```
If I run this pipeline, Beanstalk doesn't work and it puts weird error message like this.
```
Jun 21 01:58:17 ip-172-31-14-187 web: > next start
Jun 21 01:58:17 ip-172-31-14-187 web: node:internal/modules/cjs/loader:1029
Jun 21 01:58:17 ip-172-31-14-187 web: throw err;
Jun 21 01:58:17 ip-172-31-14-187 web: ^
Jun 21 01:58:17 ip-172-31-14-187 web: Error: Cannot find module '../build/output/log'
Jun 21 01:58:17 ip-172-31-14-187 web: Require stack:
Jun 21 01:58:17 ip-172-31-14-187 web: - /var/app/current/node_modules/.bin/next
Jun 21 01:58:17 ip-172-31-14-187 web: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
Jun 21 01:58:17 ip-172-31-14-187 web: at Function.Module._load (node:internal/modules/cjs/loader:871:27)
Jun 21 01:58:17 ip-172-31-14-187 web: at Module.require (node:internal/modules/cjs/loader:1098:19)
Jun 21 01:58:17 ip-172-31-14-187 web: at require (node:internal/modules/cjs/helpers:108:18)
Jun 21 01:58:17 ip-172-31-14-187 web: at Object.<anonymous> (/var/app/current/node_modules/.bin/next:3:35)
Jun 21 01:58:17 ip-172-31-14-187 web: at Module._compile (node:internal/modules/cjs/loader:1196:14)
Jun 21 01:58:17 ip-172-31-14-187 web: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
Jun 21 01:58:17 ip-172-31-14-187 web: at Module.load (node:internal/modules/cjs/loader:1074:32)
Jun 21 01:58:17 ip-172-31-14-187 web: at Function.Module._load (node:internal/modules/cjs/loader:909:12)
Jun 21 01:58:17 ip-172-31-14-187 web: at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
Jun 21 01:58:17 ip-172-31-14-187 web: code: 'MODULE_NOT_FOUND',
Jun 21 01:58:17 ip-172-31-14-187 web: requireStack: [ '/var/app/current/node_modules/.bin/next' ]
Jun 21 01:58:17 ip-172-31-14-187 web: }
Jun 21 03:42:18 ip-172-31-14-187 web: > unicare-admin@0.1.0 start
Jun 21 03:42:18 ip-172-31-14-187 web: > next start -p 8081
Jun 21 03:42:18 ip-172-31-14-187 web: ready - started server on 0.0.0.0:8081, url: http://localhost:8081
Jun 21 03:42:18 ip-172-31-14-187 web: info - Loaded env from /var/app/current/.env
```
Does anyone figure out which one would be problem in this pipeline?
Or can I have a basic build and deploy script for Next.js to AWS Beanstalk?
Regards,
Chris
This is duplicate question from https://community.atlassian.com/t5/Bitbucket-questions/Cannot-deploy-my-next-js-application-to-AWS-Beanstalk/qaq-p/2395259
I thought that I didn't publish this article when it was in moderate.
Anyway, I figured it out to rewrite my build script like below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.