fable-compiler / repl

Fable online REPL
http://fable.io/repl
MIT License
61 stars 34 forks source link

Broken in Safari #162

Closed chkn closed 8 months ago

chkn commented 1 year ago

In Safari, the REPL never loads (clicking the Code tab shows the spinner indefinitely), and there is an error in the console:

SyntaxError: Invalid regular expression: invalid group specifier name
alfonsogarciacaro commented 1 year ago

Oh, I recently made a change in a regex, not sure if related: https://github.com/fable-compiler/Fable/commit/0796241741e0d0baeb6ed70a253781e738acaa92#diff-f27c84517cce7ad7f5f496a09b678bc0449cbfd6ef079cd899d1dcb174557503

I could try adding the escape slash again (I removed it because I got a message in a Regex analyzer that it wasn't necessary but it was working before anyways), though I don't have a mac right now to test whether that was actually the problem. If you've a mac, can you please try the following code in Safari devtools to check if it raises an error?

var r = /\{\{\s*\$(\d+)\s*\?\s*(.*?)\s*:\s*(.*?)\s*\}\}/
stroborobo commented 1 year ago

I tried looking into this issue, but failed at building the standalone lib because of the stack overflow issue with large lists, specifically FSStrings in this case.

Anyways, the RegEx you posted is working.

It's likely one with a lookbehind assertion, so containing either ?<= or ?<!. The negative one (second) can be found in some files like sformat.fs, Replacements.Util.fs and BabelPrinter.fs, the others are Dart related.

JaggerJo commented 1 year ago

172

MangelMaxime commented 8 months ago

The latest version seems to be working for me in Safari, I will close this issue as this is a little old and the new version is just a few seconds old ^^.

Please feel free to open a new issue if needed