After upgrade to 4.6.0 both typescript examples take a very long time to load
See original GitHub issueCurrent behavior:
After cloning either typescript example repo ( cypress-cucumber-typescript-example or cypress-cucumber-webpack-typescript-example ) and then upgrading cypress to 4.6.0 and trying to run the tests they take a very long time (4-5 mins on my machine) to load and the browser appears to be hung. They will eventually work, but there appears to be a serious issue with the loading.
If I pause the debugger while the browser is hung, it appears to be an issue in this function from cypress_runner.js:
var extractSourceMap = function extractSourceMap(file, fileContents) {
var sourceMapMatch = fileContents.match(regexCommentStyle1) || fileContents.match(regexCommentStyle2);
if (!sourceMapMatch) return Promise.resolve(null);
var url = sourceMapMatch[1];
var dataUrlMatch = url.match(regexDataUrl);
if (!dataUrlMatch) return Promise.resolve(null);
var sourceMapBase64 = dataUrlMatch[1];
return initialize(file, sourceMapBase64);
};
The fileContents is a large file and the double regex match one the second line takes a very long time to return. Perhaps this is a Cypress issue, and those regex’s should be improved for performance? Although I assume they don’t see this issue with just Cypress.
Desired behavior:
After upgrade to 4.6.0 the tests should still run quickly.
Test code to reproduce
git clone cypress-cucumber-typescript-example or cypress-cucumber-webpack-typescript-example
node_modules\.bin\cypress open # tests run quickly and work fine
npm install --save-dev cypress@4.6.0
node_modules\.bin\cypress open # tests take a very long time to load, browser appears hung, but they eventually work
Versions
Cypress 4.6.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (1 by maintainers)

Top Related StackOverflow Question
For now I think you’ll have to stick with 4.5.0. Sorry! I will look a bit closer but it might require a cooperation with the cypress guys to solve this.
@ggere thanks again for looking so closely, that will definitely be helpful!
Root cause: https://github.com/cypress-io/cypress/issues/7464