Nightmare has stopped working

As of 3 days ago karma-nightmare has stopped working in my unit tests when running yarn test on CircleCI. I’ve tried with/without sudo and I’m still having problems. I can run the tests locally and they behave just fine.

When run on the server I get an error saying that Karma cannot start:

$ ./node_modules/karma/bin/karma start config/test/karma.conf.js
clean-webpack-plugin: /home/circleci/project/resources/dist/ is outside of the project root. Skipping...
clean-webpack-plugin: /home/circleci/project/resources/dist/ is outside of the project root. Skipping...
11 05 2018 15:15:27.809:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
11 05 2018 15:15:27.811:INFO [launcher]: Launching browser Nightmare with unlimited concurrency
11 05 2018 15:15:27.837:INFO [launcher]: Starting browser Nightmare
11 05 2018 15:15:28.048:ERROR [launcher]: Cannot start Nightmare
	
11 05 2018 15:15:28.048:ERROR [launcher]: Nightmare stdout: 
11 05 2018 15:15:28.048:ERROR [launcher]: Nightmare stderr: 
11 05 2018 15:15:28.055:INFO [launcher]: Trying to start Nightmare again (1/2).
11 05 2018 15:15:28.208:ERROR [launcher]: Cannot start Nightmare
	
11 05 2018 15:15:28.208:ERROR [launcher]: Nightmare stdout: 
11 05 2018 15:15:28.208:ERROR [launcher]: Nightmare stderr: 
11 05 2018 15:15:28.209:INFO [launcher]: Trying to start Nightmare again (2/2).
11 05 2018 15:15:28.356:ERROR [launcher]: Cannot start Nightmare
	
11 05 2018 15:15:28.356:ERROR [launcher]: Nightmare stdout: 
11 05 2018 15:15:28.356:ERROR [launcher]: Nightmare stderr: 
11 05 2018 15:15:28.357:ERROR [launcher]: Nightmare failed 2 times (cannot start). Giving up.

version: 2
jobs:
  # Builds the project and tests it
  build-and-test:
    docker:
      - image: circleci/node:latest-browsers
    steps:
      - run:
          name: "Checking Versions"
          command: |
            node --version
            npm --version
      - checkout
      - restore_cache:
          keys:
          - v2-dependencies-{{ checksum "package.json" }}
      - run:
          name: "Installing Yarn Packages"
          command: | 
            yarn install
      - save_cache:
          paths:
          - node_modules
          key: v2-dependencies-{{ checksum "package.json" }}
      - run:
          name: "Running Unit Tests"
          command: |
            yarn build
            yarn test

Has anything changed lately that might prevent this? It went from one build working to the next breaking without any change.

Have any of your dependencies changed versions accidentally? Try blitzing your deps folder locally and doing a complete re-install.

Nothing has changed - Tried doing rm -rf node_modules/ && yarn install && yarn test and it passes all tests as you’d expect. Only once it goes to CircleCI does it fail.

Fair enough. Has circleci/node:latest-browsers changed? I think this is frequently regenerated to get the latest changes (which is great for bug fixes, not so much for stability!). I believe you can see the latest Dockerfile on GitHub that builds this image.

I get the same issue with every version I use. The error really makes no sense to me.

Alright, well don’t give up just yet. :smile: See if there are some logs, or a verbose mode of operation.

I noticed that the circleci/node:<anything>-browsers images are constantly updating:

https://hub.docker.com/r/circleci/node/tags/

…and in fact NightwatchJS (which is somewhat similar to Nightmare) will not work with the updated version (and also complains about being unable to start) as of a week ago. Possibly a similar root cause?

@ehalferty: yes, I would think that is the first thing I’d look into.

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