Next.js: Getting 'SyntaxError: Invalid regular expression...' error when following setup

Created on 29 Jan 2020  路  1Comment  路  Source: vercel/next.js

Bug report

Describe the bug

Upon following the setup in the docs, I am receiving this error:

[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:3000 ...
**SyntaxError: Invalid regular expression: /(?<!pages[\\/])index\.module\.(scss|sass|css)$/: Invalid group**
    at Object.<anonymous> (/.../node_modules/next/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js:1:379)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/.../node_modules/next/dist/build/webpack/config/blocks/css/loaders/modules.js:1:206)
    at Module._compile (module.js:643:30)

To Reproduce

  1. $ mkdir new-project
  2. $ cd new-project
  3. $ npm init -y
  4. $ npm install --save next react react-dom
  5. $ mkdir pages
  6. Replace scripts in package.json
  7. $ npm run dev

Expected behavior

The dev project should compile without error and become available on localhost:3000

System information

  • OS: macOS 10.14.6
  • Version of Next.js: 9.2.1
  • Version of Node: 8.9.4

Most helpful comment

Just required updating node version. Oops.

>All comments

Just required updating node version. Oops.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sospedra picture sospedra  路  3Comments

kenji4569 picture kenji4569  路  3Comments

irrigator picture irrigator  路  3Comments

havefive picture havefive  路  3Comments

lixiaoyan picture lixiaoyan  路  3Comments