Hi folks, I'm struggling with deploying my app to AWS Beanstalk.
To begin, I'd like show some of my current source codes.
*bitbucket pipeline
*package.json
Jun 21 01:58:17 ip-172-31-14-187 web: > unicare-admin@0.1.0 start
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
Would you give me a hint to solve this problem?
Is it even possible to deploy to AWS Beanstalk using bitbucket pipeline with NextJS?
Regards,
Chris
* update #1
I figured that Bitbucket don't make ".next" folder when I run the script "npm run build".
I think ".next" directory is for the build output which is necessary. How can I make the folder with script?
I figured it out to rewrite my build script like below
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.