Unexpected character '#'
See original GitHub issueI know it’s probably not the intended use, but I was trying to parse a node file with this and received this error. The node script is designed to be a command line tool, and espree is complaining about the shebang (#!/usr/bin/env node
).
Stack Trace:
SyntaxError: Unexpected character '#'
at Parser.instance.raise.instance.raiseRecoverable (node_modules/espree/espree.js:390:19)
at Parser.pp.getTokenFromCode (node_modules/acorn/dist/acorn.js:2831:8)
at Parser.pp.readToken (node_modules/acorn/dist/acorn.js:2526:15)
at Parser.pp.nextToken (node_modules/acorn/dist/acorn.js:2518:71)
at Parser.parse (node_modules/acorn/dist/acorn.js:1631:10)
at Object.parse (node_modules/acorn/dist/acorn.js:885:44)
at Object.parse (node_modules/espree/espree.js:715:21)
This is pretty easily fixed by stripping the first line out, but it requires an extra pre-processing step. It’d be nice to either throw a warning or ignore these (or both) without crashing the process.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Unexpected Character - TV Tropes
They could be a One-Scene Wonder, someone who had succumbed to Chuck Cunningham Syndrome, simply a Living Prop, a Joke Character, or even...
Read more >1:1 error Parsing error: Unexpected character ' ' - Stack Overflow
It look like UTF-8 BOM in the begin of your file. If you have notepad++ you can remove it by click to "Encoding"...
Read more >Unexpected CHARACTER - Episode Support
"Unexpected CHARACTER". This error means the line of code before your character dialogue has an error. · "Unexpected CHARACTER or Scene change".
Read more >ParseError: Unexpected character '@' #15832 - GitHub
I'm getting this parsing error (i.e., error Unexpected character '@' ParseError ) returned when running eslint --cache --fix .
Read more >Unexpected character encountered while parsing value: S.
Unexpected character encountered while parsing value: S. 08-15-2022 01:50 AM. Hello everyone,. I have created a flow is to update my calendar invitation ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems like we probably need the special logic anyway for parsers that don’t support the option.
This is now supported in espree v9.4.0 with
ecmaVersion: 2023
.