Skip to content

Uncaught SyntaxError: Invalid or unexpected token happening out of nowhere in CI/CD #4889

@andrewryan1906

Description

@andrewryan1906

Current behavior:

All of a sudden, out of nowhere, all of my Cypress tests are failing when run in CircleCI, with the following:

Uncaught SyntaxError: Invalid or unexpected token

This error originated from your application code, not from Cypress.

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the 'uncaught:exception' event.

https://on.cypress.io/uncaught-exception-from-application

Because this error occurred during a 'before each' hook we are skipping the remaining tests in the current suite: 'Coupons'

This is happening across multiple Angular projects. I have no idea where to begin to even pinpoint the issue - when I run Cypress via cypress open, all of my tests run fine.

I'm suspicious it's one of the npm packages I updated in between deploys, so here's the package.json DIFF:

image

Desired behavior:

The builds should run properly both in headless mode in CircleCI and locally. If that doesn't work, at least give me more info so I can chase down the issue.

Steps to reproduce: (app code and test code)

  • I check in my code
  • CircleCI picks up the change and runs it
  • I get the aforementioned error in the Cypress dashboard

This just started today.

Versions

Cypress 3.4.1, Chrome 65

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions