TS9006 error using toRaw/markRaw #12285
Replies: 9 comments 4 replies
-
In the
is changed to:
then the errors goes away. But if the vue file only uses |
Beta Was this translation helpful? Give feedback.
-
Sometimes, dependency issues can cause strange type errors. Try reinstalling your node modules: rm -rf node_modules
npm install |
Beta Was this translation helpful? Give feedback.
-
maybe "compilerOptions": {
// ...
"allowJs" : true
// ...
} |
Beta Was this translation helpful? Give feedback.
-
Thanks all. I tried all these suggestions, and none worked. Regarding
|
Beta Was this translation helpful? Give feedback.
-
Thanks @Hetari . 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:
|
Beta Was this translation helpful? Give feedback.
-
The problem is I have a very large application that was already working and uses all js and options api. I'm not going to be able to rewrite the whole thing at once in ts with composition api. I guess it seems like a regression from Vue 3.4 to 3.5 that these errors just started occurring. |
Beta Was this translation helpful? Give feedback.
-
file "compilerOptions": {
...,
"composite": false, // or delete
...
} or export default {
data(){
return {
/** @type { {} } */
value1: markRaw({})
value2: toRaw({})
}
}
} |
Beta Was this translation helpful? Give feedback.
-
This might be a TypeScript issue. using "typescript": "~5.5.4" does not throw an error. |
Beta Was this translation helpful? Give feedback.
-
Thanks @Wei-Ba It did work fine in the older typescript with it on. It would be nice to know what changed in TypeScript 5.5 to cause this issue. |
Beta Was this translation helpful? Give feedback.
-
Just bumped Vue from 3.4 to 3.5 plus some other version bumps, and getting this error:
It's in an SFC file and not declaring
lang="ts"
. It uses bothtoRaw
andmarkRaw
. Why is this happening?Beta Was this translation helpful? Give feedback.
All reactions