SCSS processing causes TypeScript errors in single file components #12355
Unanswered
msarris
asked this question in
Help/Questions
Replies: 2 comments
-
Use |
Beta Was this translation helpful? Give feedback.
0 replies
-
This isn't a core issue. It looks more like an issue with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Vue version
3.3.4
Link to minimal reproduction
https://github.com/msarris/vue-typescript-bug
Steps to reproduce
npx webpack
from project root)What is expected?
A successful build without errors is expected.
What is actually happening?
A TypeScript error is displayed:
System Info
Any additional comments?
The error seems to be triggered by the processing of SCSS, but only when there's both an include of SCSS in the entrypoint and a
<style>
tag in the Vue component.When you remove the
import './_style.scss';
line from/src/script.js
the error disappears. It also disappears when the<style lang="scss">
element is removed from/src/App.vue
.The error can also be removed by changing
"noImplicitAny": true
intsconfig.json
tofalse
.I also tested this with Vite, there the issue is not present there.
It seems like a very strange interplay between sass-loader, TypeScript, Webpack and Vue.
I have no idea in which package the bug should be fixed, but I thought this repository is probably a good place to open the issue because the error is reported in the Vue component.
Beta Was this translation helpful? Give feedback.
All reactions