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

Parse error on Node.js file starting with a shebang #38

Open
gaborantal opened this issue May 14, 2019 · 0 comments
Open

Parse error on Node.js file starting with a shebang #38

gaborantal opened this issue May 14, 2019 · 0 comments

Comments

@gaborantal
Copy link
Contributor

gaborantal commented May 14, 2019

Trying to use the tool in a standard Node.js environment. It is a common thing that files start with a shebang (#!/usr/bin/env node). This cause parse error when the code is being loaded by esprima:

    at ErrorHandler.constructError (<PATH>\node_modules\esprima\dist\esprima.js:5012:22)
    at ErrorHandler.createError (<PATH>\node_modules\esprima\dist\esprima.js:5028:27)
    at ErrorHandler.throwError (<PATH>\node_modules\esprima\dist\esprima.js:5035:21)
    at Scanner.throwUnexpectedToken (<PATH>\node_modules\esprima\dist\esprima.js:5164:35)
    at Scanner.scanPunctuator (<PATH>\node_modules\esprima\dist\esprima.js:5667:19)
    at Scanner.lex (<PATH>\node_modules\esprima\dist\esprima.js:6264:22)
    at Parser.nextToken (<PATH>\node_modules\esprima\dist\esprima.js:2079:34)
    at new Parser (<PATH>\node_modules\esprima\dist\esprima.js:1916:15)
    at parse (<PATH>\node_modules\esprima\dist\esprima.js:120:19)
    at Object.parseModule (<PATH>\node_modules\esprima\dist\esprima.js:139:13)
  index: 0,
  lineNumber: 1,
  description: 'Unexpected token ILLEGAL' }

EDIT: As I see, this is already implemented, we should update the package on npm to handle this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant