-
-
Notifications
You must be signed in to change notification settings - Fork 83
Recently receiving type errors when building #77
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Actually, looking into it more this appears to be an issue with not explicitly marking a type when doing an import. So, for those issues listed above you would need to add type in front of each import. It looks like this is only required in a few places. Would it be possible to get this updated? Examples: SplideTrack.vue |
I forked this and resolved it here for reference. Feel free to update your master. Vite now requires isolatedModules and preserveValueImports in their tsconfig.json. Please see the latest @vue/tsconfig/tsconfig.json. These commits enable this to work. |
i created a PR #82 |
I encountered this issue as well after upgrading to Nuxt 3.8 which enforces Based on vue-tsc output, I can confirm the errors are caused by following lines: vue-splide/src/js/components/Splide/Splide.vue Lines 12 to 13 in a3657c7
vue-splide/src/js/constants/events.ts Line 29 in a3657c7
vue-splide/src/js/plugin/plugin.ts Line 1 in a3657c7
Still waiting #82 to be processed... |
I think the package shouldn’t be exporting typescript files in the build, I made some typescript fixes and changed the build to include only the |
Checks
Version
0.6.12
Description
I recently just started getting the following type errors trying to build with the Vue version of splide:
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/components/SplideTrack/SplideTrack.vue(10,46): error TS1444: 'Ref' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/components/Splide/Splide.vue(12,10): error TS1444: 'ComponentConstructor' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/components/Splide/Splide.vue(12,32): error TS1444: 'Options' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/components/SplideTrack/SplideTrack.vue(12,1): error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/components/Splide/Splide.vue(13,65): error TS1444: 'PropType' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/components/Splide/Splide.vue(13,84): error TS1444: 'Ref' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/constants/events.ts(29,3): error TS1444: 'EventMap' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/plugin/plugin.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
app build: ../node_modules/.pnpm/@Splidejs+vue-splide@0.6.12/node_modules/@splidejs/vue-splide/src/js/plugin/plugin.ts(1,10): error TS1444: 'App' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
Reproduction Link
No response
Steps to Reproduce
...
Expected Behaviour
The app builds normally without issue. I am wondering if you bump the main splide version from 4.1.3 to 4.1.4 if that may fix it since there was a type bug report recently reported for that here: Splidejs/splide#1003
The text was updated successfully, but these errors were encountered: