rrweb
rrweb copied to clipboard
[Bug]: Uncaught SyntaxError: Regular expression too large
Preflight Checklist
- [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
What package is this bug report for?
rrweb
Version
v2.0.0-alpha.13
Expected Behavior
Live mode replay starts
Actual Behavior
rrweb fails with an error in a console: Uncaught SyntaxError: Invalid regular expression: (huge CSS contents) Regular expression too large
Steps to Reproduce
rrweb.record({
emit(event) {
// send via websocket
},
recordCanvas: true,
dataURLOptions: {
type: 'image/webp',
quality: 0.6,
},
});
rrweb.Replayer([],
{ root: this.$refs.container,
liveMode: true,
UNSAFE_replayCanvas: true,
mouseTail: {
strokeStyle: "#d0d4e1"
}
})
Testcase Gist URL
No response
Additional Information
The same code as in "Steps to Reproduce" section worked with v1.1.3
.
CSS inside of a regex are generated by Tailwind.
We are also seeing this.
It seems to be coming from https://github.com/rrweb-io/rrweb/blob/26c331b3b7e1a45091904fd1a6a875e16c9b777f/packages/rrweb-snapshot/src/rebuild.ts#L112-L118
Yes I am also experiencing the same issue with my React Webapp. Is there any workaround?
@priyankblitzz we didn't have any workaround other than rolling back rrweb to alpha.11
I'm not sure what has changed such that it's now generating a bigger CSS regex on the first selectorMatcher
, as #1431 didn't modify that.
Does anyone have a test website that reliably generates the issue? Is that <SVG
embedded in CSS or is it in the document and somehow mistakenly going through the adaptCssForReplay function?
There's also #1458 which makes improvements and might be able to fix it although not quite currently ready for merge.
Could you guys review or apply #1481 to verify that it fixes it?
just tried the latest version(alpha 14) in my web app and it is working fine now. The issue is resolved for me now. Thank you so much for taking care of the issue.