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.

Cypress adds underscore while running tests and fails with error - Error: Cannot match any routes. URL Segment: '__'

See original GitHub issue

See following in console logs -

An unhandled error occurred Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: '__'
Error: Cannot match any routes. URL Segment: '__'
    at ApplyRedirects.noMatchError (router.js:4295)
    at CatchSubscriber.selector (router.js:4259)
    at CatchSubscriber.error (catchError.js:29)
    at MapSubscriber._error (Subscriber.js:75)
    at MapSubscriber.error (Subscriber.js:55)
    at MapSubscriber._error (Subscriber.js:75)
    at MapSubscriber.error (Subscriber.js:55)
    at MapSubscriber._error (Subscriber.js:75)
    at MapSubscriber.error (Subscriber.js:55)
    at TapSubscriber._error (tap.js:56)
    at resolvePromise (zone-evergreen.js:797)
    at resolvePromise (zone-evergreen.js:754)
    at zone-evergreen.js:858
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:39680)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at drainMicroTaskQueue (zone-evergreen.js:559)

Following is the cypress.json -

{
    "baseUrl": "http://localhost:4200",
    "fileServerFolder": ".",
    "fixturesFolder": "./src/fixtures",
    "integrationFolder": "./src/integration",
    "modifyObstructiveCode": false,
    "pluginsFile": "./src/plugins/index",
    "supportFile": "./src/support/index.ts",
    "video": false,
    "videosFolder": "../../dist/cypress/apps/e2e/videos",
    "screenshotsFolder": "../../dist/cypress/apps/e2e/screenshots",
    "chromeWebSecurity": false,
    "testFiles": "**/test.feature",
    "numTestsKeptInMemory": 0,
    "env": {
        "auth_username": "1111",
        "auth_password": "2222",
        "RETRIES": 2
    }
}

This is what I see when test runs in cypress window -

http://localhost:4200/__/#/tests/integration\maintenance\service\test.feature

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
anujpincommented, Jun 1, 2020

@jennifer-shehane , I followed https://github.com/nrwl/nx/issues/1276 to setup the tests. We are following feature files (cucumber) pattern in nrwl mono repo. Just in case that gives any pointers.

What else can I provide so that you can reproduce it on your side. Can try setting up a new project and share the repo, may be. We are halfway using cypress and now this issue is completely blocking.

0reactions
yogeshgadgecommented, May 2, 2022

This is happening to me todat angular 13 and cypress/schematics 1.6.0 , cypress 9.6.0.

Step1: Create a brand new angular project with routing - call this my-cypress-app

Step 2: ng add @cypress/schematic

Step 3: ng serve

Step 4: ng run my-cypress-app:cypress-open - click on the spec file, F12 in the another chrome window and this exact error

Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-io/cypress - Gitter
Cypress adds underscore while running tests and fails with error - An unhandled error occurred Error: Uncaught (in promise): Error: Cannot match any...
Read more >
Angular Unit testing : Error: Cannot match any routes. URL ...
In my console, I am getting this error while running my unit test case because of SubRoute. I am able to fix this...
Read more >
Changelog - Cypress Documentation
In Cypress 12, we enforce running tests in a clean browser context through ... With this change, cy.session() will no longer fail validation...
Read more >
API - esbuild
This API call is used by the command-line interface if no input files are provided and the --bundle flag is not present. In...
Read more >
PSoC Creator User Guide - Infineon Technologies
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, ... When complete, all DRC warnings and errors should...
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