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.

"TypeError: Cannot read property '0' of undefined" during clone using Parcel

See original GitHub issue

I am following the browser example and I get an error on this line in GitCommit

Uncaught (in promise) TypeError: Cannot read property ‘0’ of undefined

If I npm link a clone of the isomorphic-git repo and log out the headers variable it is an array of strings. Have I stumbled on a bug?

These are the headers:

[“tree f796b167fe72560d513ddab9321141dd539d6d47”, “parent 0793e271f0231df74410949214537936646a9b3e”, “author William Hilton wmhilton@gmail.com 1542241548 -0500”, “committer GitHub noreply@github.com 1542241548 -0500”, “gpgsig -----BEGIN PGP SIGNATURE-----”, " “, " wsBcBAABCAAQBQJb7L0MCRBK7hj4Ov3rIwAAdHIIAKS41E6rLOz3acKlh5ZJ25VV”, " JHrD5yPb/I+bjQVz9kR2+nVTfaDaciHfu+3mVHgM90b8hstzY36cEq5RaaMrrwzH", " Z1XeFG81kezc3tG/TWIwbE2xQ8S+hwO/rBZJ7814PuM10/CpUSx7qfsgCjRXTKJi", " iTkDuv+yrlHeg+Ixja3CrrAtlBlGCJB0H8RndOr7QcTmtSNZBkyNv39egaR7WjNM", " 5JbYDEAcX1BnuthiN0IQhBtXsert25DoAqb4C/GJv9GeAYGCo7/5ReinvyTy28Gp", " gO1uDojhOkvnuOKztMwcn/HgfUGKDB/eFnRccRehXi9LcXswqc6U3x8R0C1QLxg=“, " =TMTS”, " -----END PGP SIGNATURE-----", " "]

adding a console.log statement inside the loop over the normalised headers and the problem goes away ¯\_(ツ)_/¯

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
raoulmillaiscommented, Nov 29, 2018

Thanks for getting back to me @wmhilton. Sorry I was tired last night after spending half a day trying to get this working and failed to give you all the information you need to help! I should have mentioned that I am using parcel.js (with babel configured for babel-preset-env) to bundle an index file which contains almost exactly what is in the browser tutorial. I have created a minimal gist that reproduces the issue

npm install && npm start if you clone the gist

I am running:

  • MacOSX Mojave 10.14.1
  • Latest chrome (Version 70.0.3538.110 (Official Build) (64-bit)
0reactions
raoulmillaiscommented, Nov 26, 2018

Awesome. Thanks for your help @wmhilton Your solution works well and is fine for my needs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'process' of undefined #1548 - GitHub
when run parcel build , it show me the error with "Cannot read property ... The parcel 1.7.0 version is work find with...
Read more >
Why am I getting an error of "TypeError: Cannot read property ...
I was building an instagram clone with react and I kept getting an error while uploading on the uploading images feature.
Read more >
Vue cannot read property of undefined - Caritas Castellaneta
I am also using it with Vue. js?ff9b:1291 Uncaught TypeError: Cannot read property ... Share"Cannot read property of undefined" in Vue is a...
Read more >
Cannot read property '0' of undefined when trying to display data
When I try to display patient details, It is showing " Uncaught TypeError: Cannot read property '0' of undefined" Below is the code...
Read more >
Cannot edit pages after update to WP 5.5 | WordPress.org
These are the errors in my site when try to edit a page: ... wp-auth-check.min.js?ver=5.5:2 Uncaught TypeError: Cannot read property 'interval' of undefined...
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