You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used a npm package sql-formatter-plus-plus in my app, the sql-formatter-plus-plus uses regexpu-core, and my app built with esbuild. it crashes when the app starts, and it reports the following error:
Uncaught Error: Failed to recognize value `undefined` for property `Alphabetic`.
at getUnicodePropertyValueSet (rewrite-pattern.js:50:9)
at handleLoneUnicodePropertyNameOrValue (rewrite-pattern.js:68:9)
at getUnicodePropertyEscapeSet (rewrite-pattern.js:76:9)
at processCharacterClass (rewrite-pattern.js:160:13)
at processTerm (rewrite-pattern.js:205:11)
at rewrite-pattern.js:259:12
at Array.map (<anonymous>)
at processTerm (rewrite-pattern.js:258:26)
at rewrite-pattern.js:259:12
at Array.map (<anonymous>)
The error by the following code:
try{returnrequire(`regenerate-unicode-properties/${path}.js`);}catch(exception){thrownewError(`Failed to recognize value \`${value}\` for property `+`\`${property}\`.`);}
esbuild can't handle the dynamic require decided in the runtime. so the author of esbuild suggest to do the following changes:
We would have to duplicate the list of property names across to different repositories, I fear that it would easily get out of sync.
As far as I know esbuild supports plugins: you could write a plugins to make it work with dynamic requires (copying Rollup's logic to work with dynamic requires).
More specifically, you could use the https://esbuild.github.io/plugins/#on-load to intercept loading of this file (or of any files containing dynamic requires) and to replace the dynamic require call with a list of files reachable from that position.
Related issue: evanw/esbuild#2181
I used a npm package sql-formatter-plus-plus in my app, the
sql-formatter-plus-plus
usesregexpu-core
, and my app built with esbuild. it crashes when the app starts, and it reports the following error:The error by the following code:
esbuild can't handle the dynamic require decided in the runtime. so the author of esbuild suggest to do the following changes:
How do you think about it?
Thank you!
The text was updated successfully, but these errors were encountered: