Description
Checks
- Not a duplicate.
- Not a question, feature request, or anything other than a bug report directly related to Vue Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions
Version
0.6.12
Description
I have created a Vue3+TS project, and when I tried to use the @splidejs/vue-splide
module in the project, I encountered the following error:
Could not find a declaration file for module '@splidejs/vue-splide'. '/project_root/node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/dist/js/vue-splide.esm.js' implicitly has an 'any' type.
There are types at '/project_root/node_modules/@splidejs/vue-splide/src/js/index.ts', but this result could not be resolved when respecting package.json "exports". The '@splidejs/vue-splide' library may need to update its package.json or typings.ts(7016)
I referred to the package.json
configuration of @splidejs/splide
, and it seems to be an issue with the exports
field. Here are the details:
"exports": {
".": {
"require": "./dist/js/vue-splide.cjs.js",
"import": "./dist/js/vue-splide.esm.js",
"default": "./dist/js/vue-splide.esm.js"
},
"./css": "./dist/css/splide.min.css",
"./css/core": "./dist/css/splide-core.min.css",
"./css/*": "./dist/css/themes/splide-*.min.css"
}
The current version of exports
does not include the types
field in the default export. If possible, I will submit a pull request to address this issue.
Reproduction Link
No response
Steps to Reproduce
- Create Vue 3 Typescript project
- Install @splidejs/vue-splide
- Setup component containing Splide and SplideSlide
Expected Behaviour
Without TypeError.