-
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
TS error: Option 'sourceMap' cannot be specified with option 'inlineSourceMap' #8477
Comments
Could you please prepare a repository that we can run with a reproducible example? |
@bahmutov
Given the thumbs up to the original post, seems like I'm not the only one |
I have the same issue as well. Any feedback? Cypress: 5.1.0 |
Note that is also happens with Cypress 5.0.0 but not on 4.12.1. As a workaround until this issue is fixed, did someone know if it is possible to specify which {
"extends": "./tsconfig.json",
"sourceMap": false
} Thanks |
AFAIK you can only do this via the webpack loader which takes care of checking TS files. |
I see this with Cypress set up in a subdirectory, it is unable to find tsconfig.json |
We see this issue when cypress imports some code from other subproject with its own |
Place the tsconfig.json file here to override the parent folder's tsconfig.json file. https://docs.cypress.io/guides/tooling/typescript-support.html#Configure-tsconfig-json |
@haf we do have |
Not in your repro https://github.com/IlCallo/cypress-test-tiny/tree/ts-sourcemap-conflict/cypress I found this by googling the same problem. Then read the docs. Then I configured it like the docs say, and it started working. https://github.com/logary/logary-js/blob/master/cypress/tsconfig.json |
@haf that's a minimal repro, my use case have the tsconfig as suggested by the docs, but that wasn't needed to show the broken behaviour |
Look at https://www.cypress.io/blog/2019/05/13/code-create-react-app-v3-and-its-cypress-tests-using-typescript/ It helped me a lot and everything works ok My current cypress/tsconfig.json
|
Thanks @unbugx! Your answer helped me to fix the issue. I had to disable {
"extends": "../../tsconfig.json",
"include": [
"../../node_modules/cypress",
"**/*.ts"
],
"compilerOptions": {
"noEmit": false,
"sourceMap": false,
"types": ["cypress"]
},
} |
The code for this is done in cypress-io/cypress#9312, 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:
After update to Cypress 5.1, tests breaks throwing
TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
If I set
inlineSourceMap
tofalse
, the error persist.If I set
sourceMap
tofalse
, test start working again.Given that the default for
inlineSourceMap
isfalse
, that I do not set it, and that it breaks only on newer versions, I'd say the new webpack preprocessor forces theinlineSourceMap
option totrue
somewhere.This is strange because it seems like you have a whole file in place to manage this scenario: https://github.com/cypress-io/cypress-webpack-preprocessor/blob/master/lib/typescript-overrides.ts
Desired behavior:
Tests should keep working without problems
Test code to reproduce
Using a
tsconfig
withsourceMap: true
option do the trick.Edited to add repro:
https://github.com/IlCallo/cypress-test-tiny/tree/ts-sourcemap-conflict
yarn install
yarn cypress:open
Versions
Cypress: 5.1.0
OS: Ubuntu 18.04
The text was updated successfully, but these errors were encountered: