Build fails: react failed to minify

nodejs
docker
react
cci-20

#1

Hi everyone,

I work on nodejs, today my circleci build ceased to work, it fails with the following error message during the react-scripts build step:

Failed to minify the code from this file: 

 	./node_modules/agent-base/index.js:33 

Outside of docker the build works. In fact in my dev environment there isn’t an agent-base folder in my modules.

When I do npm install to populate node_modules then circleci build: it works.

I reproduce the error when I do circleci build without npm install, when the node_modules are downloaded by docker.

If I checkout the commit that worked yesterday and I do circleci build, it fails!

My docker image is based on circleci/node:6.10.3 in which I added aws cli but I didn’t edit it recently.

Here are the circleci steps:

    steps:
      - checkout
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: Set npm login token
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
      - run:
          name: Install npm modules
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
      - run:
          name: Build static app
          command: npm run build

I guess that the node_modules downloaded by docker are not the same that the one downloaded in my environment, but I don’t understand why and how to fix it.

Thanks for your help :slight_smile:


#2

This is fixed. It came from different node/npm versions in my dev environment and in the docker image.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.