-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
sfc without typescript is failing type check #12286
Comments
Please follow the issue requirement and provide a minimal runnable reproduction |
The error doesn't come up when running Should I create a github repo for it, or upload a zip file? |
Here is a repo link that reproduces it: Note that HelloWorld.vue is a non-typescript sfc. If you clone, and run:
These errors should occur:
Should I open a new issue, or do you want to re-open this one? |
a workaround // util.ts
import { markRaw as _markRaw } from 'vue'
export const markRaw = (obj: any) => _markRaw(obj)
// comp.vue
import { markRaw } from './utils'
import { toRaw } from 'vue';
export default {
data() {
return {
value1: markRaw({}),
value2: toRaw({}),
}
},
} |
Thanks @edison1105 . Your workaround does indeed seem fix that error. It does seem though that the error wasn't caused by something about
The referenced node modules have not changed since updating to Vue 3.5. I tried excluding those sfc files in tsconfig.app.json, but that had no effect for some reason, not sure why. Are you able to pinpoint exactly why these errors are only occurring since updating to Vue 3.5? What would you say is the resolution of this issue for all 3 errors? |
This might be a TypeScript issue. using |
Vue version
3.5.12
Link to minimal reproduction
https://github.com/jacobg/vue-project-ts
Steps to reproduce
Since updating Vue 3.4 to 3.5, I'm seeing build errors like this:
That particular component uses
markRaw
andtoRaw
.But the vue sfc file only uses
<script>
and not<script lang="ts">
, so such an error is not expected.In the
tsconfig.app.json
file if:is changed to:
then the errors goes away.
What is expected?
No build error
What is actually happening?
Error TS9006
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: