Hi there I'm trying to build and deploy a `nextjs` but my pipeline brakes when building the project.
I'm beginning to believe that there's something wrong with the docker images inside the pipelines or something that I'm not understanding. I had the same problem with a previous project in react , pipeline build process failed with an error message about `node_modules`
The pipeline fails with this error:
$ yarn run build:development && pm2 restart $USER-frontendv2-develop$ env-cmd -f .env.development next build/home/$USER/$USER-frontendv2/node_modules/next/dist/telemetry/storage.js:101notify = ()=>{^SyntaxError: Unexpected token =at Module._compile (internal/modules/cjs/loader.js:723:23)at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)at Module.load (internal/modules/cjs/loader.js:653:32)at tryModuleLoad (internal/modules/cjs/loader.js:593:12)at Function.Module._load (internal/modules/cjs/loader.js:585:3)at Module.require (internal/modules/cjs/loader.js:692:17)at require (internal/modules/cjs/helpers.js:25:18)at Object.<anonymous> (/home/$USER/$USER-frontendv2/node_modules/next/dist/build/index.js:37:16)at Module._compile (internal/modules/cjs/loader.js:778:30)at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
This is my `pipeline.yml`
image: node:18.12.0
pipelines:
branches:
main:
- step:
name: Running Lint and Prettier.
script:
- yarn install
- yarn run lint
- yarn prettier
- step:
name: Deploying development 🚀
caches:
- nodeall
- yarn
script:
- echo 'Connecting to remote server to update repo'
- node --version
- yarn --version
- nvm --version
- pipe: atlassian/ssh-run:0.4.1
variables:
SSH_USER: $USER
SERVER: $SERVER_ADRESS
COMMAND: " cd smiling-scripts && bash frontendv2-deploy-development.sh"
# MODE: "script"
# COMMAND: "../smiling-scripts/frontendv2-deploy-development.sh"
definitions:
caches:
nodeall: ./node_modules
yarn: /usr/local/share/.cache/yarn