Hi there I'm trying to build and deploy my react app using bitbucket pipelines, I have built and deploy other ones, but for some reason this one is throwing me the following error
<span> Building the project 👷🏽‍♂️</span>
<span>----------------------</span>
<span>yarn run v1.22.5</span>
<span>$ env-cmd -f .env.development react-scripts build</span>
<span>Creating an optimized production build...</span>
<span>Failed to compile.</span>
<span>TypeError: (intermediate value)(intermediate value)(intermediate value).slice(...).reverse(...).flatMap is not a function</span>
<span>error Command failed with exit code 1.</span>
<span>info Visit <a href="https://yarnpkg.com/en/docs/cli/run" rel="noopener nofollow noreferrer" target="_blank">https://yarnpkg.com/en/docs/cli/run</a> for documentation about this command.</span>
<span>Connection to $SERVER_ADRESS closed.</span>
<span>✖ Execution failed.</span><span><br>----------------------</span>
I can build the project locally, and I can actually manually deploy it as well when I connect to the server and run `yarn run build:develop`, but for some reason it breaks on the pipeline.
Here is my `bitbutcket-pipeline.yml` for reference.
image: node:15.2.1
pipelines:
branches:
"{master,main}":
- step:
name: Deploying development 🚀
caches:
- nodeall
- yarn
script:
- echo 'Connecting to remote server to update repo'
- node --version
- npm --version
- pipe: atlassian/ssh-run:0.2.2
variables:
SSH_USER: $USER
SERVER: $SERVER_ADRESS
COMMAND: "cd smiling-scripts && bash admin-deploy-dev.sh"
definitions:
caches:
nodeall: ./node_modules
yarn: /usr/local/share/.cache/yarn
EDIT: 23.08.2022
Hi @Theodora Boudale
thanks for the reply. Yes that's the error I get from the command pipe: atlassian/ssh-run:0.2.2 (and - pipe: atlassian/ssh-run:0.4.1) now that I have changed it.
I don't get any errors when I connect to my server and build it manually. It builds without errors. Same as when I do it locally.
I can't understand why is only braking on the pipeline script. I have deleted the `node_modules` and reinstalled everything on the server but now I get the following error on the pipeline (so at least is not the same one 🙃, but still unable to build)
yarn run v1.22.5
$ env-cmd -f .env.develop react-scripts build
/home/$USER/$USER-admin-develop/node_modules/eslint-webpack-plugin/node_modules/jest-worker/build/index.js:110
_ending;
^
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)