I've got a react application with Next.js that triggers a google cloud trigger to build a docker image and do some other things based on a cloudbuild.yaml file.
This application builds successfully locally, but when I'm building it on the Gcloud the logs show:
Step #1: > Using external babel configuration
Step #1: > Location: "/app/.babelrc"
Step #1: Failed to compile.
Step #1: > Build error occurred
Step #1: Error: > Build failed because of webpack errors
Step #1: at build (/app/node_modules/next/dist/build/index.js:7:847)
Step #1: at runMicrotasks (<anonymous>)
Step #1: at processTicksAndRejections (internal/process/task_queues.js:93:5)
Step #1: npm ERR! code ELIFECYCLE
Step #1: npm ERR! errno 1
Step #1: npm ERR! xxx@0.1.0 build: `next build`
Step #1: npm ERR! Exit status 1
Step #1: npm ERR!
Step #1: npm ERR! Failed at the xxx@0.1.0 build script.
Step #1: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Step #1:
Step #1: npm ERR! A complete log of this run can be found in:
Step #1: npm ERR! /root/.npm/_logs/2019-09-13T11_23_36_719Z-debug.log
Step #1: The command '/bin/sh -c npm run build' returned a non-zero code: 1
Locally however it's a completely different story
Creating an optimized production build ...
> Using external babel configuration
> Location: "C:\Users\name\Documents\GitHub\xxx\.babelrc"
Compiled successfully.
Anyone know a good way to debug this issue?
Thanks.