question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

locahost server issue

See original GitHub issue

Orb and Docker Image result in localhost server error

I’m sure there is a simple solution to this but have not found a clearcut way to resolve. It seems every time CircleCi runs npm start it spins up a new server but our Cypress is set up to look for http://localhost:3040 and not a dynamic host

  • what version of the orb are you currently using? cypress-io/cypress@1

cypress.json

{
    "baseUrl": "http://localhost:3040"
}

CircleCi job using orb

cypress/run:
         requires:
           - build
         command: npx cypress run 
         record: true
         store_artifacts: true
         start: npm start
         wait-on: 'http://localhost:3040'

CircleCi job using Docker Image

  cypress-test:
    docker: 
      - image: cypress/included:6.1.0
        environment:
          TERM: xterm
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
            - v1-deps-{{ .Branch }}
            - v1-deps
      - run:
          name: Install Dependencies
          command: npm ci
      - save_cache:
          key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
          paths:
            - ~/.npm
            - ~/.cache
      - run: 
          name: Start Server
          command: npm start
      - run: $(npm bin)/cypress run 

Screenshots of error messages / failed tests Screen Shot 2021-01-22 at 4 40 15 PM Screen Shot 2021-01-25 at 1 48 03 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ncote3commented, Mar 12, 2021

Another thread in the react-scripts repo had some sort of solution using docker compose? Seems like web-pack’s issue may be related to the shell needing to stay alive.

The thread is here, but I’m not sure how to configure it using docker-compose run on circle-ci: https://github.com/facebook/create-react-app/issues/8688#issuecomment-602149917

1reaction
bahmutovcommented, Feb 1, 2021

Please run this command on CI to show the logs from wait-on on CircleCI

Read more comments on GitHub >

github_iconTop Results From Across the Web

Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
Localhost refused to connect error can be caused by an incorrectly configured port, insufficient permissions, or an inoperative web server.
Read more >
Localhost Refused to Connect - How to Fix the Error
The server being blocked by the firewall. · Localhost doesn't resolve to 127.0.0.1. · Apache failing to run properly. · DNS failing to...
Read more >
Localhost down today December, 2022 ... - UpdownRadar
Localhost website down Today December, 2022? Can't log in? Real-time problems and outages - here you'll see what is going on.
Read more >
How to Resolve MAMP's “Localhost Refused to Connect” Error ...
2. Allow Incoming Connections · 3. Check MAMP's Document Root · 4. Change the Port Settings · 5. Verify That Your Apache Web...
Read more >
localhost http 500 internal server error - Stack Overflow
2 Answers 2 · I found apache_error file which gives. Child 3528: Starting 150 worker threads. Child 3528: Starting thread to listen on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found