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
Cypress component tests fail to run when using @react-data-table-component -- ^7.5.2 #22678
Comments
This appears to be specific to Vite. Everything worked fine in my project using Webpack. I'm still looking into the issue |
Was able to reproduce this issue using React 17 and Vite with the dependencies mentioned. It looks like the actual error might be happening in Styled Components here. |
Possibly related: styled-components/styled-components#3744 Seems this is a more general Vite problem than something specific to Cypress? I did get styled-components working in a fresh React 18 + Vite app, though. Hm. |
Update: I went into I wonder if https://www.npmjs.com/package/@emotion/is-prop-valid is getting pulled in somewhere, and defining |
I couldn't find out what the problem is exactly, but I have a work around for now: https://github.com/cypress-io/cypress/compare/styled-components?expand=1 In your import { defineConfig } from 'vite'
import replace from '@rollup/plugin-replace'
import reactPlugin from '@vitejs/plugin-react'
export default defineConfig({
plugins: [
replace({
values: {
'process.env': `(process.env || {})`,
},
}),
reactPlugin({
jsxRuntime: 'classic',
}),
],
}) I'm not sure if this has any side effects - there's a lot of ways to configure |
I think this was related to Vite. Vite 3 is out, I wonder if this is fixed? Happy to reopen if needed. |
Current behavior
Running Cypress component tests (Cypress ^10.3.0) results in the following error message for all the tests:
Desired behavior
The cypress component tests should run correctly
Test code to reproduce
Cypress Version
^10.3.0
Other
cypress config
No response
The text was updated successfully, but these errors were encountered: