-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Typescript support: Update documentation for plugins.ts #7005
Comments
I am not encountering this error actually. Although I do not see the |
Interesting, I have found out it makes a difference how to start cypress.
results into the error from above. cypress.json
|
Confirmed. It happens when the Cypress root folder is not located at the default path. How to reproduce1. Create Cypress project like below:
2. Create a tsconfig.json with these options: {
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}
3. Run cypress like below:
It fails. Cause of the Problem.When the project is not located at the default path and tsconfig.json has Help wanted.How should we emulate |
Quick note: your export is incorrect, since it is a named export
It should be
|
I also had a problem with plugin.ts and found working solution: `// plugins file function register(): void { export = register; |
@sainthkh you can from the root of the monorepo run |
The code for this is done in cypress-io/cypress#7197, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
plugin.ts:
Fails with
Desired behavior:
Should work without any issue or the documentation should state it.
The workaround is the following:
Test code to reproduce
Use the first snippet.
Versions
4.4.0
The text was updated successfully, but these errors were encountered: