Closed OTheNonE closed 6 months ago
Any updates? I am facing the same issue 😢
It appears the package is missing the "types"
from the "exports"
statement in the package.json
:
{
"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 1.3.6-beta.0
, can you please try installing it and confirm if it works?
I can confirm that this specific issue is solved. There is no typescript error, typescript can find the package, and when running npm run check
, it displays no errors nor warnings.
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 <VisAxis tickFormat={(event) => { ... }/>
, and there are many other general type problems with all the components. I'll open a new issue.
@huntabyte (cc @michaelbelete @OTheNonE) Thanks for pointing it out! I've just published
1.3.6-beta.0
, can you please try installing it and confirm if it works?
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 "moduleResolution": "NodeNext"
the components aren't able to be resolved due to a missing file extension in index.js
:
- export * from './containers';
- export * from './components';
+ export * from './containers.js';
+ export * from './components.js';
The ideal approach would be to use "moduleResolution": "NodeNext"
in the library's tsconfig.json
to ensure regressions aren't introduced and support for both Node and bundlers is provided.
Reference: https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution-for-libraries
https://github.com/f5/unovis/assets/64506580/5e4336d8-5390-485e-b14e-97a5cbd172c0
@huntabyte (cc @michaelbelete @OTheNonE) Thanks for pointing it out! I've just published
1.3.6-beta.0
, can you please try installing it and confirm if it works?
@rokotyan 1.3.6-beta.0
fixed my problem. Thank you 🙌🏼
@huntabyte @shyakadavis @michaelbelete
1.3.6-beta.1
addresses this problem and ready to be tested, thanks for pointing it out!
We'll need to update Typescript version in our project to use "moduleResolution": "NodeNext"
and there were some problems with this. But one day we'll definitely do it.
This does fix the issue, thank you!
This issue is persisting with the latest version of @unovis/svelte
:
It appears this part of the package.json
didn't make it into the release:
{
"exports": {
".": {
+ "types": "./index.d.ts",
"svelte": "./index.js"
}
}
}
@huntabyte I can't believe we missed it, thanks for reporting. Use 1.4.1-beta.0
as a quick fix
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: