Regex error when used with a minifier that turns unicode characters into ASCII
See original GitHub issueIf ascii_only
is set to true
on uglify-js
, react-pdf
will throw the following error:
SyntaxError: invalid range in character class
Issue stems from hyphen
. 1.4.1 version of this package is unusable with Create React App in its default configuration, as CRA has ascii_only
set to true
by default.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to encode unicode characters with the pattern "\u ...
new UglifyJsPlugin({ uglifyOptions: { output: { // This was turned in the app because "emoji and regex" values // were not minified properly ......
Read more >UTS #18: Unicode Regular Expressions
Unicode is a large character set—regular expression engines that are only adapted to handle small character sets will not scale well. Unicode ......
Read more >uglify-js - npm
UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit. Note: uglify-js supports JavaScript and most language features in ...
Read more >API Reference - Terser
Previously known as "output options". ascii_only (default false ) -- escape Unicode characters in strings and regexps (affects directives with ...
Read more >Regex Tutorial - Non-Printable Characters
If your regular expression engine supports Unicode, you can use \uFFFF or \x{FFFF} to insert a Unicode character. The euro currency sign occupies...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @oskarkook ! Otherwise we will just have to fork it and publish a new version under
@react-pdf
scope. Let’s wait some days or otherwise just follow that pathCurrent solution is to use 1.4.0. I’ve opened a PR in hyphen, but who knows if/when it will be accepted.