Skip to content

vite.config missing after CT onboarding - unexpected error #26849

Open
@MikeMcC399

Description

Current behavior

The Cypress desktop app shows the message "Unexpected error" if a default onboarding setup is followed after selecting Front-end framework React.js and bundler Vite.

No vite.config.* is found.

Unexpected error

Desired behavior

The Cypress desktop app should not throw any error after completing a default onboarding setup using Front-end framework React.js and bundler Vite. A minimal vite.config.* should be created by the onboarding process.

Test code to reproduce

Execute in a terminal window:

mkdir cy-vite-ct
cd cy-vite-ct
git init
npm init -y
npm install cypress@latest -D -E
npx cypress open

In the Cypress desktop app:

Click on "Component Testing"
Select Front-end framework React.js and Bundler Vite
Click "Next step"
Copy and paste the command as instructed:
npm install -D vite react react-dom
You've successfully installed all required dependencies.
Click "Continue", click "Continue"
Note "Unexpected Error" looking for a file named vite.config.*

  • (Cypress 13.16.1 is not compatible with vite@6 and react@19, so steps to reproduce do not currently work exactly.)

Cypress Version

First reported on Cypress 12.13.0
Continues to be reproducible on Cypress 14.0.3

Node version

18.17.1, v20.18.0 v22.14.0

Operating System

  • Ubuntu 22.04
  • Ubuntu 24.04.2 LTS
  • Windows 11

Debug Logs

No response

Other

Workaround

Add a barebones vite.config.js file according to https://vitejs.dev/config/ and restart npx cypress open

// vite.config.js
export default {
  // config options
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    CTIssue related to component testingTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.type: unexpected behaviorUser expected result, but got another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions