firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.21k stars 198 forks source link

A critical error has occurred #2062

Open Wind010 opened 1 year ago

Wind010 commented 1 year ago

Bug Description

A critical error has occurred when pasting a long string into Test string textbox. Possibly same issue with the Patten box.

Reproduction steps

  1. Select ECMAscript Flavor
  2. Use pattern /\p{Emoji}/u, but I suspect any simple pattern will reproduce it.
  3. Continually copy a long string into the the Test string textbox.

Expected Outcome

There should be limit to the Test string and the page should not crash.

Console log:

Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at i.lineInner (vendors-bundle.c49ab84005e4d8d9f85a.js:2:346139)
    at i.lineAt (vendors-bundle.c49ab84005e4d8d9f85a.js:2:344557)
    at fn.blockAt (vendors-bundle.c49ab84005e4d8d9f85a.js:2:461831)
    at xn.elementAtHeight (vendors-bundle.c49ab84005e4d8d9f85a.js:2:479073)
    at $n.elementAtHeight (vendors-bundle.c49ab84005e4d8d9f85a.js:2:507751)
    at Mt (vendors-bundle.c49ab84005e4d8d9f85a.js:2:439709)
    at $n.posAtCoords (vendors-bundle.c49ab84005e4d8d9f85a.js:2:509495)
    at bundle.afaefc6ee24c1d714907.js:1:338347
    at bundle.afaefc6ee24c1d714907.js:1:338568
    at bundle.afaefc6ee24c1d714907.js:1:339442
    at i (vendors-sentry.6fea3ab873d9298d6dd5.chunk.js:1:29403)

Browser

Chrome Version 113.0.5672.64 (Official Build) (64-bit)

OS

Microsoft Windows Version [10.0.19044.2846]

image

firasdib commented 1 year ago

I am unable to reproduce this. Can you show a video or something?

Wind010 commented 1 year ago

Sure, note that the string copied was just a random generated string from alpha-numeric character set: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 This time using Edge version Version 113.0.1774.42 (Official build) (64-bit)

https://github.com/firasdib/Regex101/assets/17187851/6fadbf81-5c21-4541-9907-4d79b82f6aa7

firasdib commented 1 year ago

This looks like a bug in CodeMirror.... It seems it cannot handle that large texts for some reason.

firasdib commented 11 months ago

Can this still be reproduced?

DingJC17 commented 9 months ago

I also encountered this issue while copying long text image

firasdib commented 1 month ago

Anyone run into this again?