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 · 2 comments
Open

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

xinaesthete opened this issue Apr 8, 2024 · 2 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.

@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?

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

2 participants