question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Cannot read property '0' of undefined" on repeated Vector.appendAll

See original GitHub issue

This code:

import { Vector } from 'prelude.ts';

let v = Vector.ofIterable(Array(15).fill(1));

for (let i = 0; i < 100; i += 1) {
  console.log(i);
  v = v.appendAll(Array(1000).fill(1));
}

Will fail after 86 iterations with:

TypeError: Cannot read property '0' of undefined
    at Vector.getLastNode (node_modules/prelude.ts/src/Vector.ts:279:31)
    at Vector.appendAllArrays (node_modules/prelude.ts/src/Vector.ts:457:34)
    at Vector.appendAll (node_modules/prelude.ts/src/Vector.ts:419:25)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bwbuchanancommented, Sep 6, 2018

Well, I’m using it in a production system, so that tends to find all the edge cases! 😃

0reactions
emmanueltouzerycommented, Sep 6, 2018

I released 0.7.13 with the fix! Thank you for the patience and the detailed bug reports!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix: Cannot Read Property '0' of Undefined - Coding Beauty
The “cannot read property '0' of undefined” error occurs when you try to access the 0 index of an array-like variable, but the...
Read more >
Cannot read property '0' of undefined - Stack Overflow
It seems you have an array of objects and each object has a brands property that contains an array of objects. Your second...
Read more >
ArrayBase in ndarray - Rust - Docs.rs
An n-dimensional array. The array is a general container of elements. The array supports arithmetic operations by applying them elementwise, if the elements ......
Read more >
ميډياويکي:Vector-opt-out - ويکيپېډيا
Detect buggy property enumeration order in older V8 versions. ... if (!condition) { var error = void 0; if (format === undefined) {...
Read more >
LSSTApplications: lsst::daf::base::PropertySet Class Reference
Append all value vectors from the source to their corresponding properties. Sets values if a property does not exist. If a property already...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found