question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS error: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'

See original GitHub issue

Current behavior:

After update to Cypress 5.1, tests breaks throwing TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. If I set inlineSourceMap to false, the error persist. If I set sourceMap to false, test start working again.

Given that the default for inlineSourceMap is false, that I do not set it, and that it breaks only on newer versions, I’d say the new webpack preprocessor forces the inlineSourceMap option to true 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 with sourceMap: true option do the trick.


Edited to add repro: https://github.com/IlCallo/cypress-test-tiny/tree/ts-sourcemap-conflict

  • clone locally
  • yarn install
  • yarn cypress:open
  • click on “spec.ts” test
  • witness the error

Versions

Cypress: 5.1.0 OS: Ubuntu 18.04

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:20
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
IlCallocommented, Sep 8, 2020

@bahmutov Here it is: https://github.com/IlCallo/cypress-test-tiny/tree/ts-sourcemap-conflict

  • clone locally
  • yarn install
  • yarn cypress:open
  • click on “spec.ts” test
  • witness the error

Given the thumbs up to the original post, seems like I’m not the only one

1reaction
IlCallocommented, Oct 28, 2020

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

error TS5053: Option 'sourceMap' cannot be specified with ...
In that file - remove the sourceMap option - ts won't generate the .map files any more. Not sure where the inlineSourceMap is...
Read more >
Errors from compilation when adding Typescript source map
ERROR in [default] Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'. I don't understand why it's mentioning the options ...
Read more >
inlineSourceMap - TSConfig Option
All the configuration options for a project. Classes. How to provide types to JavaScript ES6 classes. Made with ♥ in Redmond, Boston, SF...
Read more >
ts-loader
First, for ts-loader to produce sourcemaps, you will need to set the tsconfig.json option as "sourceMap": true . Second, you need to set...
Read more >
API - ESBuild
The transform API can take the following options: Simple options: Define; Format; Loader; Minify; Platform; Sourcemap; Target. Advanced options:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found