Svgr: SVGR invalid regular expression

Created on 3 May 2020  路  3Comments  路  Source: gregberge/svgr

I have a project created with CRA, and it compiles and runs perfectly on one machine (Ubuntu 18.04) but when I clone and install and try to run this on a different machine that is also Ubuntu 18.04 I get an error:

ERROR in ./src/assets/imgs/RecoveryPlan.svg Module build failed (from ./node_modules/@svgr/webpack/lib/index.js): SyntaxError: Invalid regular expression: /[\p{Lu}]/: Invalid escape

My webpack loader looks like this:
{ test: /\.svg$/, use: ['@svgr/webpack'] }

Building and running from my main machine causes no errors, but on this secondary machine the build fails

Any ideas what might be causing this error? Nothing at all about the project changes so I am not sure why this is happening, all node versions are the same. I tried googling the issue and I cant seem to find anyone who has replicated it.

wontfix

Most helpful comment

I have the same issue on CI using Node 8.15.1 and MPM 6.4.1.
Local all works fine using Node 12.11.1 and NPM 6.13.1

The error is thrown in Dependency camelcase index.js:11
This change, drops support for version 8 and 6.

I updated node on CI to 12.16.3 which fixes the bug.

All 3 comments

Hey @lm93547 :wave:,
Thank you for opening an issue. We'll get back to you as soon as we can.
Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers.
If you use SVGR at work, you can also ask your company to sponsor us :heart:.

I have the same issue on CI using Node 8.15.1 and MPM 6.4.1.
Local all works fine using Node 12.11.1 and NPM 6.13.1

The error is thrown in Dependency camelcase index.js:11
This change, drops support for version 8 and 6.

I updated node on CI to 12.16.3 which fixes the bug.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings