Skip to content

Cypress Component Testing is not running in a new Vite+React+TypeScript project #23114

@jude-lawson

Description

@jude-lawson

Current behavior

Hi Cypress Team!

First off, thanks for making a great tool. I've been using Cypress for awhile and I just wanted to take the briefest of moments to appreciate the work you've done.

My issue is related specifically to Cypress Component Testing. I am adding Cypress Component Testing to a project that uses Vite+React+TypeScript. After setting up the project with the standard settings from Vite's React-TS template, adding Cypress, and running the automated configuration to set up component testing and running the new test, the Cypress app freezes on the "Your tests are loading..." screen.

Desired behavior

When I start the newly created test, the test should load and show the default <App /> component I am rendering with cy.mount in the test.

Test code to reproduce

I've set up a repo to replicate the issue. I'm using Cypress Component Testing in a little different context, but I distilled the issue down to a minimum reproducible example found here: https://github.com/jude-lawson/cy_vite_repro

The steps to reproduce are in the repo's README!

Cypress Version

10.4.0

Other

I've reached out for help on the Cypress Discord and was directed here to get some additional help. As mentioned before I am trying to use Cypress Component Testing in a little different context (a monorepo), but the isolated workspace is still a brand new Vite+React+TS project, just like the minimum reproducible example (which is not a monorepo).

I'm using pnpm, but I've also tried this with npm as well just to eliminate pnpm as a variable and the issue still occurred.

Thanks for any help you can provide, and please let me know if there are any other steps I can take or additional information that I can provide.

Metadata

Metadata

Assignees

Labels

CTIssue related to component testingtype: bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions