cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.8k stars 3.17k forks source link

An error occurs when adding vite-plugin-cypress-esm #29436

Open MagedWilliamdevlink opened 5 months ago

MagedWilliamdevlink commented 5 months ago

Current behavior

I get this error after i add CypressEsm() to plugins, which didn't happen before. image

It does render my component but then it hit this error it renders nothing.

Desired behavior

To render as expected without this issue

image

Test code to reproduce

I hosted the issue code on a Github repo https://github.com/MagedWilliamdevlink/cypress-esm/tree/main

Cypress Version

13.8.1

Node version

20.9.0

Operating System

Windows 11 26100.1

Debug Logs

Nothing showed in the terminal

Other

No response

MagedWilliamdevlink commented 4 months ago

following the section about known issues resolved this somewhat, even though i`m not using lazy imports, I turned every arrow function component into a function and removed any imports like:

import DynamicForm from "./DynamicForm";
export default DynamicForm;

This requires changes in my project file structure which may not be viable