Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not find a declaration file for module 'zarr'" #152

Open
xinaesthete opened this issue Apr 8, 2024 · 3 comments
Open

"Could not find a declaration file for module 'zarr'" #152

xinaesthete opened this issue Apr 8, 2024 · 3 comments

Comments

@xinaesthete
Copy link

xinaesthete commented Apr 8, 2024

I don't seem to be able to import from zarr in TypeScript without getting this error:

Could not find a declaration file for module 'zarr'. '/project/node_modules/zarr/zarr.mjs' implicitly has an 'any' type.
There are types at '/project/node_modules/zarr/types/zarr.d.ts', but this result could not be resolved when respecting package.json "exports". The 'zarr' library may need to update its package.json or typings.

This is with freshly created npm create vite@latest - I tried a couple of permutations of settings, nothing that made a difference. I also tried importing from 'zarr/core' - again, no different.

@xinaesthete
Copy link
Author

xinaesthete commented Apr 11, 2024

The issue is with "moduleResolution": "bundler" in tsconfig.json (which is the default with npm create vite@latest as of this writing). Changing to "node" works.

froyo-np added a commit to AllenInstitute/vis that referenced this issue May 7, 2024
… that we use extensively get resolved correctly. this is an issue on their end: gzuidhof/zarr.js#152
froyo-np added a commit to AllenInstitute/vis that referenced this issue May 8, 2024
… that we use extensively get resolved correctly. this is an issue on their end: gzuidhof/zarr.js#152
froyo-np added a commit to AllenInstitute/vis that referenced this issue May 13, 2024
* delete ye olde build script

* add some react for UI - think about if I like it or it will make my life nice

* fix a perf bug in which we consider rendering every slice in a grid regardless of zoom level.
some (better?) smoke and mirrors trickery to try to obscure redraw flickering when panning/zooming

* working but messy impl of a worker pool that handles decoding zarr chunks for us

# Conflicts:
#	apps/layers/package.json

* play around with WW pool size, and fix a bug in which the optional render-working budget parameters were being ignored (for the slice renderer specifically)

* move a shocking amount of code in to render slide-view style annotations

# Conflicts:
#	apps/layers/package.json

* good enough for now

# Conflicts:
#	apps/layers/src/demo.ts

* respect queue params

* enable screenshots, with a default output resolution of roughly 85MP

# Conflicts:
#	apps/layers/package.json
#	apps/layers/src/demo.ts
#	pnpm-lock.yaml

* start thinking about upside down data...

* its all upside down now  great

* minor tidy, plus a rough attempt at a less flickery stand-in algorithm

* tools to add layers during demotime

# Conflicts:
#	apps/layers/src/demo.ts

* add a versa layer

* add scatterplot-slideview real quick

# Conflicts:
#	apps/layers/src/demo.ts

* start some cleanup so I can merge this...

# Conflicts:
#	apps/layers/src/demo.ts

* Merge branch 'noah/layered-demo' into noah/layered-with-react-whynot

# Conflicts:
#	apps/layers/src/demo.ts

* quickly change the underlying cache type for scatterplots for much better perf (gpu buffer not client-buffer)

* try out sds components for quick hacky ui fun - delete old ui code

* add a bunch of per-layer ui elements

* prev/next layer buttons

* take a snapshot button

* quickly re-enable drawing layers

* a bit hacky, but non-flickering drawings are worth it for a demo

* change moduleResolution in the apps tsconfig to make the zarr library that we use extensively get resolved correctly. this is an issue on their end: gzuidhof/zarr.js#152

* cleanup some increasingly scary cherrypicks, and finally tidy up those last little demo ts errors.

* clean up a bunch of low hanging fruit

* fix up the scatterplot (standalone) demo

* readme and demo script

* a little more

* copy in the latest and greatest annotation stuff in

* minor cleanups

* fix wrongly named example
froyo-np added a commit to AllenInstitute/vis that referenced this issue May 13, 2024
* first step to layered rendering: one layer!

* bufferPair gets its own file in common/

* technically functional rendering of layers of ome-zarr slices and scatterplot points.

* dig up the old ccf average-template data... todo ask scott for better chunk-sizes!

* I can load a slide-view slide and the average_template ccf (ask scott for a better one) and show them togeather, although their dimensions suggest that they are radically different sizes

* get the dang things to line up by fixing all my goofy voxel math

* aaaaaaah what a wild bug

* a little less sloppy

* fun idea but breaks visibility determination

* generalize layers, build up convenience around frames, more formal types to be rendered

* a working (but somewhat confusing) generic layer (impl for scatterplots first)

* both layer types working

* delete half-baked approach

* pull out common stuff (target) from generic types to make things less confusing

* add a super basic annotation (just lines) renderer, wrap it in a layer thingy

* fix a lil slop

* minor changes as I prepare to add some sort of UI

* working but very strange imgui implementation... lets see if its nice

* add some UI - not in love withit

* draw after loading

* start to merge the two different zarr rendering methods

* less hacky way of picking an appropriate resolution, although its still a bit iffy...

* thinking about skipping ui and just having json state...

* super basic optional transforms for layers. next up a grid of these things

* add a volume grid layer, mild cleanup elsewhere

* draw data as it arrives - and prepend frames with low-res data to cover the pan case

* refactor various types and loaders to make it easier to configure an instance with a list of simple config payloads. separate data types from the code that would render them. updates to demo to use new loaders

* lets serve the app with parcel

* Get layers app Parcelized

* Noah/layers pt2 (#23)

* delete ye olde build script

* add some react for UI - think about if I like it or it will make my life nice

* fix a perf bug in which we consider rendering every slice in a grid regardless of zoom level.
some (better?) smoke and mirrors trickery to try to obscure redraw flickering when panning/zooming

* working but messy impl of a worker pool that handles decoding zarr chunks for us

# Conflicts:
#	apps/layers/package.json

* play around with WW pool size, and fix a bug in which the optional render-working budget parameters were being ignored (for the slice renderer specifically)

* move a shocking amount of code in to render slide-view style annotations

# Conflicts:
#	apps/layers/package.json

* good enough for now

# Conflicts:
#	apps/layers/src/demo.ts

* respect queue params

* enable screenshots, with a default output resolution of roughly 85MP

# Conflicts:
#	apps/layers/package.json
#	apps/layers/src/demo.ts
#	pnpm-lock.yaml

* start thinking about upside down data...

* its all upside down now  great

* minor tidy, plus a rough attempt at a less flickery stand-in algorithm

* tools to add layers during demotime

# Conflicts:
#	apps/layers/src/demo.ts

* add a versa layer

* add scatterplot-slideview real quick

# Conflicts:
#	apps/layers/src/demo.ts

* start some cleanup so I can merge this...

# Conflicts:
#	apps/layers/src/demo.ts

* Merge branch 'noah/layered-demo' into noah/layered-with-react-whynot

# Conflicts:
#	apps/layers/src/demo.ts

* quickly change the underlying cache type for scatterplots for much better perf (gpu buffer not client-buffer)

* try out sds components for quick hacky ui fun - delete old ui code

* add a bunch of per-layer ui elements

* prev/next layer buttons

* take a snapshot button

* quickly re-enable drawing layers

* a bit hacky, but non-flickering drawings are worth it for a demo

* change moduleResolution in the apps tsconfig to make the zarr library that we use extensively get resolved correctly. this is an issue on their end: gzuidhof/zarr.js#152

* cleanup some increasingly scary cherrypicks, and finally tidy up those last little demo ts errors.

* clean up a bunch of low hanging fruit

* fix up the scatterplot (standalone) demo

* readme and demo script

* a little more

* copy in the latest and greatest annotation stuff in

* minor cleanups

* fix wrongly named example

---------

Co-authored-by: Lane Sawyer <[email protected]>
@lazarusA
Copy link

Getting the same error. Also changing to node seems to work. Maybe it would be a good idea to fix this issue directly in Zarr.js, instead of changing local configs?

@kahole
Copy link

kahole commented Sep 3, 2024

Would this PR fix this? #149
Would be great to use zarr.js with "moduleResolution": "bundler"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants