-
Notifications
You must be signed in to change notification settings - Fork 49
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
Cannot find module '@unovis/svelte' or its corresponding type declarations. #343
Comments
Any updates? I am facing the same issue 😢 |
It appears the package is missing the {
"exports": {
".": {
+ "types": "./index.d.ts",
"svelte": "./index.js"
}
}
} Refernece - Svelte packaging docs: https://kit.svelte.dev/docs/packaging#anatomy-of-a-package-json-exports |
@huntabyte (cc @michaelbelete @OTheNonE) Thanks for pointing it out! I've just published |
I can confirm that this specific issue is solved. There is no typescript error, typescript can find the package, and when running Although, i was hoping that this would solve the autocompletion and type infering of some of the svelte components. Specifically, i currently get no autocompletion nor type of "event" when doing |
Awesome, thanks a ton! Would have submitted a PR but was limited on time and realized I needed to submit the CLA. |
I'm experiencing another related issue when new projects are using - export * from './containers';
- export * from './components';
+ export * from './containers.js';
+ export * from './components.js'; The ideal approach would be to use Reference: https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution-for-libraries CleanShot.2024-03-06.at.11.56.27.mp4 |
@rokotyan |
@huntabyte @shyakadavis @michaelbelete
We'll need to update Typescript version in our project to use |
This does fix the issue, thank you! |
This issue is persisting with the latest version of It appears this part of the {
"exports": {
".": {
+ "types": "./index.d.ts",
"svelte": "./index.js"
}
}
} |
@huntabyte I can't believe we missed it, thanks for reporting. Use |
There is a typescript error when using the svelte part of Unovis:
The modules works, and the project builds, but the types do not work. Types work though in the TS part of the module. Related to this, i notice in
node_modules
that thets
-folder has atypes.d.ts
-file while thesvelte
-folder has not. Does this have anything to do with this?This is my
tsconfig.json
file:The text was updated successfully, but these errors were encountered: