smastrom / vue-collapsed

🏋️‍♂️ CSS height transition from any to auto and vice versa for Vue and Nuxt. Accordion ready.
https://vue-collapsed.pages.dev
MIT License
123 stars 8 forks source link

Error when build with vue-tsc #13

Closed Yyooogurt closed 11 months ago

Yyooogurt commented 11 months ago

Terminal command: vue-tsc --noEmit && vite build --mode production

node_modules/vue-collapsed/dist/index.d.ts:1:15 - error TS1005: ',' expected.

1 import { type PropType } from 'vue';

If I delete the word type in the index.d.ts, the build runs normally. Please tell me how to fix this error so that you don't have to go to the root of the add-on after each update of the packages.

Vue-collapsed version - 1.1.3

smastrom commented 11 months ago

Hi Yogurt, try to add skipLibCheck to your tsconfig.json:

{
   "compilerOptions": {
      "skipLibCheck": true,
   },
}
Yyooogurt commented 11 months ago

I already have this option in tsconfig.json (

{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom", "dom.iterable"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"skipLibCheck": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
}
smastrom commented 11 months ago

You can try to add it to your CLI command: vue-tsc --noEmit --skipLibCheck && vite build --mode production

Yyooogurt commented 11 months ago

You can try to add it to your CLI command: vue-tsc --noEmit --skipLibCheck && vite build --mode production

Good idea, but the result is the same (

smastrom commented 11 months ago

I had another good idea, try to update to the latest version and check if the error is still there:

pnpm add vue-collapsed@latest

Yyooogurt commented 11 months ago

I had another good idea, try to update to the latest version and check if the error is still there:

pnpm add vue-collapsed@latest

@smastrom Thank you very much, this solved my problem 🤝