2.19.0: rules.map is not a function
See original GitHub issueI’m using moo 0.5.0, with nearley 2.18.0. Upgrading to 0.5.1 and 2.19.0 respectively, then re-generating the parsers causes the following error:
TypeError: rules.map is not a function
at Function.Grammar.fromCompiled (/blah/blah/node_modules/nearley/lib/nearley.js:173:27)
The preceding call in the stack is const parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar));
, where the grammar is compiled with nearleyc grammar.ne -o src/grammar.ts
.
I’m using node 10.17.0 with typescript 3.5.3. Have you come across this issue?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
TypeError: rules.map is not a function - React js - Stack Overflow
selectedFormJSON.FORM_RULE is an object. You cannot use map on an object.
Read more >TypeError: map() is not a function in React | bobbyhadz
The "TypeError: map is not a function" occurs when we call the map() method on a value that is not an array. To...
Read more >2.19.7 Data-Mapping Attribute Rules, Clauses, and Directives
2.19.7 Data-Mapping Attribute Rules, Clauses, and Directives. This section describes how the data-mapping and data-sharing attributes of any variable ...
Read more >google earth engine - mosaic.map is not a function
You can not map over a single image. After you calculated the median of your collection, you receive only one image and .map...
Read more >aws-cdk-lib module - AWS Documentation
A Stack is the smallest physical unit of deployment, and maps directly onto a ... As a final note: Stack s are not...
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
I was having this issue. Workaround when you’re importing your grammar do this:
Instead of:
Unfortunately it seems this affects
nearley-test
as I get the same error message when trying to use the test CLI command.No problem, glad I can help!