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: Unexpected reserved word

See original GitHub issue

I am trying to add commitlint to an Ionic project. This project is in version 3.

Expected Behavior

It should works like docs.

Current Behavior

I’m getting this error when run commitlintcommand.

Explorer.js:54
    for await (const place of this.config.searchPlaces) {
        ^^^^^

SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    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)
    at Object.<anonymous> (/Users/edigleyssonsilva/workspaces/estudaqui/estudaqui/mobile_app/node_modules/@commitlint/load/node_modules/cosmiconfig/dist/index.js:12:17)

Here is my conf file

module.exports = {
    extends: ['@commitlint/config-conventional'],
    "rules": {
      "header-max-length": [0],
      "scope-case": [0],
      "subject-case": [0]
    }
  }

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. First step
  2. Second step
commitlint.config.js ```js module.exports = { extends: ['@commitlint/config-conventional'], "rules": { "header-max-length": [0], "scope-case": [0], "subject-case": [0] } } ```

Context

Your Environment

Executable Version
commitlint --version I can’t because of the error
git --version 2.24.3
node --version 8.17.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
escapedcatcommented, Jan 17, 2021

Right, thanks @armano2 !
@geeksilva97 we do not support node version lower than 10 anymore.

2reactions
armano2commented, Jan 16, 2021

This issue is actually not related to commitlint, but to cosmiconfig, as pointed above, we do not support node <10 anymore, to make it work with newer version you must upgrade your node version to >10.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Syntax Error Unexpected Reserved Word in ...
The error Unexpected Reserved Word means that the JavaScript compiler saw a reserved word, meaning a keyword special to the compiler, when it ......
Read more >
unexpected reserved word import in node.js - Stack Overflow
I've received error unexpected reserved word on import in Node.js file. The lines in file core.module.js is: 'use strict'; import lodashMixins ...
Read more >
How to Solve unexpected reserved word await in JavaScript
To solve unexpected reserved word await error in JavaScript, declare your function as async. The error “unexpected reserved word await” ...
Read more >
Ubuntu and node getting SyntaxError: Unexpected reserved ...
Ubuntu and node getting SyntaxError: Unexpected reserved word. Hi! I'm having a lot of trouble trying to compile with npm on Ubuntu 22.04....
Read more >
SyntaxError: "x" is a reserved identifier - JavaScript | MDN
The JavaScript exception "variable is a reserved identifier" occurs when reserved keywords are used as identifiers. Message. SyntaxError: Unexpected ...
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