Closed jamesm131 closed 2 weeks ago
Thanks for opening the issue. This makes me think you might have slightly different versions of zarritas different packages. Can you share you package.json?
Btw, this is a clever hack! Not something I want end users to rely on, so I'm sure we'll find a fix!
Ah thank you, it was a versioning issue! I thought I was using the most recent version of all packages, but pnpm update didn't update the zarrita packages (I'm not sure if this is because of their next flag, some distribution method, or a some weird config on my machine).
Sorry for raising this as an issue. I had a feeling it was a version problem as it occurred after I ran a pnpm update of @zarrita/core but I was having trouble reproducing. Thank you again!
For completeness sake, the versions that were not working, and the updated versions below. // old "@zarrita/core": "0.1.0-next.8", "@zarrita/indexing": "0.1.0-next.14", "@zarrita/ndarray": "0.1.0-next.10", "@zarrita/storage": "0.1.0-next.4", // new "@zarrita/core": "0.1.0-next.12", "@zarrita/indexing": "0.1.0-next.14", "@zarrita/ndarray": "0.1.0-next.14", "@zarrita/storage": "0.1.0-next.5",
I recently ran an update on my node modules and ran into this new error. (I'm having a hard time nailing down exactly which version introduced it). I get the error "Cannot read properties of undefined (reading 'TypedArray')" when using get to access zarr data, but not when using getChunk().
I've had a poke around in the code and found that in indexing package, the context variable is always undefined because _internal_get_array_context cannot view the zarrita context symbol on the array object.
I've not had much experience in ts/js package development, so the best I could do on my own was to edit the @zarrita/indexing/dist/src/get.js file with the below changes to get things working.
This is working as expected, though I'm aware that this is quite hacky and likely has some consequences I haven't thought of, but I couldn't get the arr object to recognise the CONTEXT_MARKER symbol in the hierarchy file, nor could I properly export the CONTEXT_MARKER symbol and import it alongside the array getter (a consequence of the crude ad-hoc editing of node-modules).
I apologise if this is a consequence of a user error. I am wrapping the AsyncReadable class with aws4fetch to use with an S3 bucket, but I don't believe that this would be the cause of the issue. (code attached below just in case there is something obvious).
I'd be happy to be of more help if you can point me in the right direction, but like I said, I've not got much experience in developing js/ts packages.
My AsyncReadable wrapper code for reference: