Skip to content
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

invalid expression error #67

Closed
davvit opened this issue May 1, 2020 · 2 comments
Closed

invalid expression error #67

davvit opened this issue May 1, 2020 · 2 comments

Comments

@davvit
Copy link

davvit commented May 1, 2020

I am getting the following error with latest version:
"camelcase": "^6.0.0",

this is my usage
const functionName = camelCase(file.slice(0, -5).split("/").join("_"));

Detailed stack trace: SyntaxError: Invalid regular expression: /[\p{Lu}]/: Invalid escape
    at preserveCamelCase (/srv/node_modules/camelcase/index.js:11:3)
    at camelCase (/srv/node_modules/camelcase/index.js:63:11)
    at Object.<anonymous> (/srv/index.js:24:24)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
@davvit davvit closed this as completed May 1, 2020
@sschuberth
Copy link

I'm running into a similar issue. What was your solution @davvit?

@Qix-
Copy link
Contributor

Qix- commented Oct 7, 2020

In the future when making bug tickets, please specify the environment and version within which you're using the library.

Node.js:

  • If you are using Node.js < 8.3.0, upgrade to at least 8.3.0 (preferably, at least 10.0.0)
  • If you are using Node.js >= 8.3.0 < 10.0.0, pass the --harmony flag to your node process.
  • This should be working on Node >= 10.0.0

Browser:

  • Does not work in any version of IE (note that Edge is not IE)
  • To view browser support, look for your target browser's version support for "Unicode Escapes" on the MDN Regular Expression compatibility page

Going to lock this for now since there's nothing actionable - this is valid Javascript. Not targeted at either of the individuals above, but please do not open any new issues asking us to backport or remove the unicode handling - it is up to you to upgrade your environments when they're so terribly outdated they cannot run even the most remotely modern Javascript.

EDIT: nevermind, I'm not a maintainer anymore xD ping @sindresorhus

Repository owner locked and limited conversation to collaborators Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants