"TypeError: Cannot read property '0' of undefined" during clone using Parcel
See original GitHub issueI 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:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
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 gistI am running:
Awesome. Thanks for your help @wmhilton Your solution works well and is fine for my needs.