Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to build for cypress #19315

Closed
7 tasks done
ciobanudann opened this issue Jan 29, 2025 · 1 comment
Closed
7 tasks done

Failing to build for cypress #19315

ciobanudann opened this issue Jan 29, 2025 · 1 comment

Comments

@ciobanudann
Copy link

Describe the bug

When running Cypress component tests with Vite, it fails on some sourceUrl variable assign.
Tried to setup a new vite project, to install mixpanel again and use it in the App component, the tests are failing too

Reproduction

https://github.com/ciobanudann/cypress-vite-mixpanel-error

Steps to reproduce

  1. Setup vite project
  2. Install cypress
  3. Install mixpanel
  4. Create a component test
  5. Run the test

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 125.64 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.1 -
    Yarn: 1.22.22 
    npm: 10.8.2 -
    pnpm: 9.15.0 -
    bun: 1.1.33 -
    Watchman: 2024.10.21.00 -
  Browsers:
    Chrome: 132.0.6834.112
    Safari: 17.4.1
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.4
    vite: ^5.4.8 => 5.4.11

Used Package Manager

npm

Logs

[plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.

3298| if (sourcemap) {
lines.push(...)
}
3301| return lines;

at TransformPluginContext._formatError (file:////node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:49255:41)
at TransformPluginContext.error (file:////node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:49250:16)
at TransformPluginContext.transform (file:////node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:63993:14)
at async PluginContainer.transform (file:////node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:49096:18)
at async loadAndTransform (file:///node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:51929:27)
at async viteTransformMiddleware (file:///

Validations

@sapphi-red
Copy link
Member

This is a bug in cypress (cypress-io/cypress#30889) and is fixed by cypress 14.0.1.

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

No branches or pull requests

2 participants