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 CT & Next: getting webpack errors during component mounting after using Cypress' setup wizard

See original GitHub issue

Current behavior

I’m currently working on getting Cypress Component Testing up and running in my team’s repo. It’s a monorepo managed by NX. Components are React.

I had hoped to save myself from some config headaches by running Cypress in global mode at the root of the repo, and then using the configuration wizard to set up component testing in the desired app folders.

I can see that this wizard is currently in alpha, but I gave it a go (using 10.6.0):

Screenshot 2022-08-22 at 11 35 17

The wizard didn’t flag any issues:

Screenshot 2022-08-23 at 16 44 45 Screenshot 2022-08-23 at 16 44 55

Unfortunately I am getting webpack errors when I attempt to mount a component:

Screenshot 2022-08-24 at 13 29 09

And the browser window simply says Cannot GET /__cypress/src/index.html

Screenshot 2022-08-24 at 13 31 59

Side note: the wizard didn’t add a component-test action to my project.json, which the devs tell me is crucial for NX setups.

Desired behavior

As well as detecting that my repo is running on Next, it is able to detect additional configurations and include them in cypress.config.ts or wherever they need to go

Test code to reproduce

I don’t have a public repo to highlight this issue. However I’m talking this through with Jonathan C at Cypress, and am happy to join a call to give further context

Cypress Version

10.6.0

Node version

16.15.0

Operating System

macOS 12.5.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
liambutlercommented, Sep 16, 2022

Thanks Zach

There’s already an issue raised with NX here: https://github.com/nrwl/nx/issues/11785. It’s been closed, but they’ve committed to working on it

@lmiller1990 sorry I missed your question. The configuration provided to me by @rockindahizzy was enough to get me up and running. Thanks for the help, everyone!

2reactions
liambutlercommented, Aug 29, 2022

Haven’t forgotten about this. Working on putting a minimal reproduction together

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component Testing Config - Cypress Documentation
When you launch Cypress for the first time in a project, the app will automatically guide you through setup and configuration. You don't...
Read more >
Cypress Webpack Compilation Error create-react-app
Hi, after migration from cypress 9.5.4 to 10.11.0 I have a lot of Webpack Compilation Errors that i didnt have before. Some of...
Read more >
Cypress - quasar-testing
We support scaffolding code coverage configuration for Cypress tests, when using Vite-based Quasar CLI. To generate reports, run test:e2e:ci and/or test: ...
Read more >
React Component Testing with Cypress 10
Ok, after we have everything cleaned, let's jump to the docs and see what is required from us to get this going. I...
Read more >
@cypress/webpack-preprocessor - npm
Cypress preprocessor for bundling JavaScript via webpack. Latest version: 5.16.0, last published: 9 days ago. Start using ...
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