Skip to content
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

[vue3.x] TypeScript Build Error #649

Closed
recallwei opened this issue Oct 9, 2022 · 9 comments
Closed

[vue3.x] TypeScript Build Error #649

recallwei opened this issue Oct 9, 2022 · 9 comments
Labels

Comments

@recallwei
Copy link

recallwei commented Oct 9, 2022

When I publish the site to vercel, the build failed error occurred. It seems like TypeScript error.

The error message is below.

ef97b3a789d0d7b12b6118d5458cb6f

Also, you can fork my repository (https://github.com/recallwei/resume-generator) and run pnpm install then pnpm build, and can find the build error message.

Environment

  • OS & Version: [ macOS, Windows 11 ]
  • Vue version: [v3.2.39]
  • Component Version: [ v4.1.0-beta.2 ]
@recallwei recallwei added the bug label Oct 9, 2022
@Blackfaded
Copy link
Contributor

Having the same issue

@NightCatSama
Copy link
Owner

Try to set skipLibCheck in tsconfig to true.

@recallwei
Copy link
Author

Add skipLibCheck in tsconfig does't work for me.
I remove the vue-tsc --noEmit TypeScript check in the build script temporarily.
That works.

@NightCatSama
Copy link
Owner

NightCatSama commented Oct 14, 2022

@recallwei Is node_modules excluded from tsconfig? Normally, components in node_modules should not be type checked.

"exclude": [
    "node_modules"
]

@Blackfaded
Copy link
Contributor

My config also included skipLibCheck and "exclude": [ "node_modules" ], but getting the error, too. Maybe a bug in vue-tsc?

@recallwei
Copy link
Author

Yes, I got the same result even after adding "exclude": [ "node_modules" ].

@Blackfaded
Copy link
Contributor

Temporarily fixed it by

// stub/vue-slider-component.d.ts
// This needs to be stubbed until the vue-slider-component library fix their types
// https://github.com/johnsoncodehk/volar/issues/2018

export { DefineComponent } from 'vue';

and

 "paths": {
      "@/*": ["src/*"],
      "vue-slider-component": ["stubs/vue-slider-component.d.ts"]
    },

in tsconfig.json

@sifex
Copy link

sifex commented Nov 17, 2022

If anyone else is struggling with this one, answer found in #652

npm install vue-slider-component@4.1.0-beta.6

@joe-soboleski-visiontree

still seems an issue in 4.1.0-beta.7. Downgrading to 4.1.0-beta.6 did not help. Config already includes skipLibCheck and excludes node_modules. Only thing that helped was stubbing out the .d.ts file @Blackfaded mentioned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants