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.

After upgrade to 4.6.0 both typescript examples take a very long time to load

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
lgandeckicommented, May 24, 2020

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!

0reactions
ggerecommented, May 25, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto imports ( getExportInfoMap ) extremely slow #46735
Issue Type: Performance Issue. trying to use ctrl + space loading... for a period of time when I disabled it from builtin extensions...
Read more >
Documentation - TypeScript 4.4
For example, we can write a type with an index signature that takes string keys and maps to boolean values. If we try...
Read more >
What TypeScript version is Visual Studio Code using? How to ...
The --save-dev will update your project's package.json , adding the TypeScript version you installed as a devDependency . Open VS Code Workspace Settings...
Read more >
Preload critical assets to improve loading speed - web.dev
You can use that knowledge to request the critical resources ahead of time and speed up the loading process. This post explains how...
Read more >
Announcing TypeScript 4.5 - Microsoft Developer Blogs
Disabling Import Elision. There are some cases where TypeScript can't detect that you're using an import. For example, take the following code:.
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