-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error using online Peggy - Can't find variable: util #371
Comments
Doesn't reproduced for me. What exactly online editor did you mean? https://peggyjs.org/online? I tried to paste https://raw.githubusercontent.com/accordproject/concerto/cd9edf745a85f6b7fec818b700810a3a9f5bee0a/packages/concerto-cto/lib/parser.pegjs an the parser was generated without errors. Input {
'$class': 'concerto.metamodel@1.0.0.Model',
decorators: [],
namespace: 'test',
imports: [],
declarations: []
} |
Interesting! I just tried it in Chrome and it works, so it appears to be an issue specific to Safari. I am using |
I can reproduce this in Safari. This looks to be an error in node-inspect-extracted. I'm going to try updating to the latest version of that package first, then see if there is still a problem. |
This should be fixed in Safari 16.4 according to this. I think maybe we should just test for util being available, and fall back on |
OK, take a look at the pretty awful hack that is #372. I'd rather not change the offending line in node-inspect-extracted for two reasons: capturing the intent of the negative lookbehind adequately will be a little tough, and b) I'm trying to keep that code as close to nodejs source as possible. |
I forgot to mention, that I've checked on Firefox 110.0.1, but I also use the old Firefox ESR 52.9.0 because of its plugins, and this error affects it also (of course) |
* main: Update deps, CHANGELOG, version. Rebuild. Fix typos. Move parens to correct place. Rebuilt patch from scratch, incorporating comments Update dependencies Remove --optimize. Fixes peggyjs#392. --allowed-start-rule=\* documented for CLI. Fixes peggyjs#386. Put parens around integer conversions in repetition. Fixes peggyjs#381. Tweaking the error format() documentation Authors and small grammar fix Change silver to hex Update to node-inspect-extracted@2.0.2 Update CHANGELOG Make online version work in old browsers. Fixes peggyjs#371. Updating grammarSource documentation Add Marcel Bolten to authors Remove redundant options variants in behavior test Handle null and undefined explicitly Fixes peggyjs#374. CLI was throwing exception on grammar errors without a CLI test also being specified. Stub out new CHANGELOG.md section
When I use a parser within the Peggy online editor the parser displays an error:
The same parser works when used from the command line or in a Node.js application.
The web-browser (latest Safari) displays the following two error messages in the console:
To reproduce
Can't find variable: util
appears below the parser input window.The text was updated successfully, but these errors were encountered: