question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Invalid regular expression flags From 6.6.0 Release

See original GitHub issue

Tell us about your environment

  • ESLint Version: 6.6.0
  • Node Version: lts/carbon
  • npm Version: 5.5.1

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

Configuration

My eslint-config extends: https://github.com/cerner/eslint-config-terra/blob/master/eslint.config.js

"eslintConfig": {
    "extends": "terra",
    "settings": {
      "polyfills": [
        "Promise"
      ]
    },
    "rules": {
      "import/no-extraneous-dependencies": "off",
      "import/no-unresolved": "off",
      "camelcase": "off",
      "class-methods-use-this": "off"
    },
},

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint. The latest eslitn version was pulled in during a CI build and failed lint tests.

I was able to reproduce by removing my node_modules dir locally and running install again. Running eslitn resulting in errors.

> eslint --ext .js,.jsx .

What actually happened? Please include the actual, raw output from ESLint. This recent change is causing builds to fail with the following error:

> eslint --ext .js,.jsx .

/Users/er047227/orion/chart-summary/chart-summary-component/node_modules/eslint/lib/source-code/source-code.js:426
        return /\s/u.test(text.replace(/\/\*.*?\*\//gus, ""));
                                       ^

SyntaxError: Invalid regular expression flags
    at NativeCompileCache._moduleCompile (/Users/er047227/orion/chart-summary/chart-summary-component/node_modules/v8-compile-cache/v8-compile-cache.js:242:18)
    at Module._compile (/Users/er047227/orion/chart-summary/chart-summary-component/node_modules/v8-compile-cache/v8-compile-cache.js:186:36)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (/Users/er047227/orion/chart-summary/chart-summary-component/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/Users/er047227/orion/chart-summary/chart-summary-component/node_modules/eslint/lib/source-code/index.js:4:17)
    at Module._compile (/Users/er047227/orion/chart-summary/chart-summary-component/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
platinumazurecommented, Oct 26, 2019

Can we just make a change to not require this flag? The s flag just means dots represent newlines, right? Could we use something like [\s\S] instead of dot and then we could remove the s flag?

2reactions
kaicataldocommented, Oct 26, 2019

The latest major release line of ESLint currently supports the following engines:

{
    "node": "^8.10.0 || ^10.13.0 || >=11.10.1"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: invalid regular expression flag "x" - MDN Web Docs
The JavaScript exception "invalid regular expression flag" occurs when the flags in a regular expression contain any flag that is not one ...
Read more >
SyntaxError: invalid regular expression flag "x" - JavaScript
The JavaScript exception "invalid regular expression flag" occurs when the flags, defined after the second slash in regular expression literal, ...
Read more >
Failed to start server (60s timeout) and ... - Sonar Community
I am using the latest version of Sonarqube. ... gus, "")); ERROR: ^ ERROR: ERROR: SyntaxError: Invalid regular expression flags ERROR: at ...
Read more >
Uncaught SyntaxError: Invalid regular expression flags
@Barmar I got this VM2734:1 and this Uncaught SyntaxError: Invalid regular expression flags at p (jquery.min.js:2) at Function.
Read more >
Changelog - Cypress Documentation
Fixed an issue where the incorrect Cypress version could be shown in the ... testIsolation=false caused invalid configuration validation when running ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found