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

With 0.3.3 I get lexer error on first line #144

Closed
ghost opened this issue Nov 29, 2013 · 6 comments
Closed

With 0.3.3 I get lexer error on first line #144

ghost opened this issue Nov 29, 2013 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 29, 2013

Previously everything was ok (0.3.2 works), the line has "Feature: " as the beginning. It happens with more .feature files.

@jbpros
Copy link
Member

jbpros commented Nov 29, 2013

Can you share some failing feature files?

@ghost
Copy link
Author

ghost commented Nov 30, 2013

[root@a cucumber]# cat user\ logging\ into\ system.feature | gzip -c9 - | base64
H4sIACfLmVICA7WUTU7kQAyF95zCYsMd2CHBICRgA2jW7o5JSiSuUHa6xdlmMUfiCtjV1YT0nwSo
d0n8bL/P5cr7v/9/CHVIdA5PQgnaWAsE1gjaEMibKHUnADcMMVUWt8CMAGct+eMgBJTw/uoR5rHr
IxOrmPxCAD2YPBWWyOpqq22lYVr7xCQPc2JMIZoHNlFNVU4GIRJYUmu1CXqsCZZBG68T2NIArsOC
2Do0uCDgqFCyY1p9Wr8Oaq6fY6Kc9bfJSYsgQc1Q0IBtLp+jjx69pGccWgXse5AmDm3l2G3Eiqqs
uuDKSpSQ+VyZgkSvA4luS9ycy5DfMhtjRxvsd2alMyeH0IPKZ7rVqryt0W0Po5CjQO2GwBMqOL32
l9OjTsGHvXcMrikm3NueSUy3oKzkLw58ZSELMq4ptoC/aMwk7zjPMjCUl3GZx1ndfJmQ4gtxEVmR
3GNKeLvJ98ND/CHZ5hlto639HGTzMjvgLoPMIzPNdf9F9t1NVGQQew1xxwk3aPQwS9F7FrEJV3cB
+wCOfLxtHg3+5l4/fU7gbI3A9Rksm2A/0fHLbvoWa1uh+tuwE46xCXQkMl2MwyAf0/STPCEGAAA=

@jbpros
Copy link
Member

jbpros commented Nov 30, 2013

The file seems to be encoded as UTF-8 with BOM. Gherkin (the parser) seems to not like the marker and does not expect it at the start of the file. Try saving that file again as UTF-8 without BOM. I could get your feature to load properly by doing so.

This is a known problem on Gherkin: cucumber/gherkin#100. We can't do much about it on Cucumber.js itself.

@simondean
Copy link
Contributor

Hi @jbpros. Would it be ok to reopen this issue until cucumber/gherkin#100 is fixed?

Here's the cryptic error message I see when a feature file includes a UTF-8 BOM (http://en.wikipedia.org/wiki/Byte_order_mark):

...\node_modules\gherkin\lib\gherkin\lexer\en.js:1008
      throw new Error("Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.");
^
Error: Lexing error on line 1: 'Feature: Example feature'. See
http://wiki.github.com/cucumber/gherkin/lexingerror for more information.
    at Lexer.scan
(...\node_modules\gherkin\lib\gherkin\lexer\en.js:1008:13)
    at Object.parse
(...\node_modules\cucumber\lib\cucumber\parser.js:26:25)
    at Object.getFeatures
(...\node_modules\cucumber\lib\cucumber\runtime.js:24:35)
    at Object.start
(...\node_modules\cucumber\lib\cucumber\runtime.js:10:37)
    at Object.self._task

@MikeLevan
Copy link

I am experiencing the same thing on the latest version 0.4.7. Just bumping this issue up in hopes it'll get fixed soon.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants