Can't have tsconfig.json in Cypress-cucumber-typescript for React
See original GitHub issueI have a project with React, Cypress-cucumber-preprocessor, Typescript(output in es5).
When I run the cypress with official example or another example, it has those problems:
TypeScript error: cypress/integration/Google/google.ts(5,3): Error TS2304: Cannot find name 'cy'.
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
If I delete tsconfig.json
in React parent folder, it fixed the Syntax Error
but it still has TypeScript error
.
So it seems like tsconfig.json
make this problem, but the project should not without tsconfig.json
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Can't have tsconfig.json in Cypress-cucumber-typescript for ...
I modified the tsconfig.json file from my project's root folder to ignore the cypress folder. Try this too to test, here it worked....
Read more >Can't have tsconfig.json in Cypress-cucumber-typescript for ...
I have a project with React, Cypress-cucumber-preprocessor, Typescript(output in es5). When I run the cypress with official example or ...
Read more >TypeScript - Cypress Documentation
Configure tsconfig.json · Open the command palette (Mac: cmd+shift+p , Windows: ctrl+shift+p ) · Type "restart ts" and select the "TypeScript: Restart TS...
Read more >Use TypeScript With Cypress - Gleb Bahmutov
If we try to use ES6 features in our specs, VSCode will show an error, and Cypress test will not be transpiled. ......
Read more >Migrate a Cypress Cucumber Project To Use TypeScript
Firstly, we need to install TypeScript into the project: npm install --save-dev typescript. The next step is to add the tsconfig.json file ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
CSchulz - Can you please explain what webpack configuration you used. I have same issue when using it with an Angular solution
Hello, @WeihsuPeach. Do you have some line like
"types": ["cypress"]
in yourtsconfig.json
file?I think that this problem is related to the fact that
tsify
is using the project’s roottsconfig.json
to process your code. You can add types declaration to the root file. On the other hand, you can pass anothertsconfig.json
file to thetsify
.I’m not sure whether this approach will work but it’s worth trying.