TypeError: Cannot read property 'toString' of null
See original GitHub issueI have a bunch of “seed” files that populate development and test dbs. One file in particular has about 550 seed lines, each about 2k characters long (inline maps with string keys, hash rockets, and values).
If I run prettier over it, it errors with:
[error] db/seeds/categories.seeds.rb: TypeError: Cannot read property 'toString' of null
[error] at Object.module.exports [as parse] (/Users/noah/dev/ebth-com/node_modules/@prettier/plugin-ruby/src/parse.js:7:30)
[error] at Object.parse$2 [as parse] (/Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:10641:19)
[error] at coreFormat (/Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:13858:23)
[error] at format (/Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:14117:73)
[error] at formatWithCursor (/Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:14133:12)
[error] at Object.formatWithCursor (/Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:42401:15)
[error] at format$1 (/Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:43770:21)
[error] at /Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:43965:16
[error] at /Users/noah/dev/ebth-com/node_modules/prettier/bin-prettier.js:43905:14
[error] at Array.forEach (<anonymous>)
If I cut it up at all (in an attempt to binary-search which lines it chokes on), prettier returns correct file, which makes me think it’s about the size of the hashes or the size of the call and not something inside the hash.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'toString' of null
So whenever you try to access a property under a value of null or undefined in JavaScript and try to read any property,...
Read more >TypeError: Cannot read property 'toString' of null #304 - GitHub
The issue is that the default value of id is null and the IdFixer component is broken, as it accesses toString of null....
Read more >TypeError: Cannot read property 'toString' of null - Help
What seems to be the problem: I am getting a JavaScript error on date field <input class="form-control" data-inputmask-alias="datetime" ...
Read more >TypeError: Cannot read property 'toString' of null
TypeError : Cannot read property 'toString' of null ... Description of the problem: Hello, when I try to run my experiment on pavlovia...
Read more >Autocomplete Cannot read property 'toString' of null - Syncfusion
Autocomplete Cannot read property 'toString' of null · Hi Robert, · A support incident to track the status of this defect has been...
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 Free
Top 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
Wow this is really great thanks for the report! So this has actually exposed a bug wherein we were passing the content of the file to be parsed as an argument to a spawned process, whereas we should have been writing it to
stdin
. The size of your file hit theE2BIG
error from node and was even breaking out error handling. The referenced PR fixes this, and I’ll push up a new version later today with the fix (will end up beingv0.3.8
).Actually this ended up being
v0.4.0
because I bundled it with another change. It’s now out.