We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
Learn more about funding links in repositories.
Report abuse
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
3.5.13
https://play.vuejs.org/#eNrNVE2P2jAQ/SsjXwAJBQG7PbCA1FZ72ErdrXY5Wlo5yRBMEzuyHT5E+e8dO2xIBdr2Umkv0djz5s3zm9gH9rkso02FbMKmNjGydGDRVSXkQmUzzpzlbM6VLEptHBzA6Wdc9uG72McYIuM/FMERlkYX0CGyDldcJVpZB8WecmhQJTicNGVTVRUxmjnMfH13OBr37q5UjCgfGnbbNB7aBkUbkVdI0JvbT3cwGMBiXyJ06hYdkBaUdiCslZkScY5ECS5AXjqR/0CiqzyFGEGSAKGcFA5T2Eq3AqFAmFg6I8y+rtquZLI6l1TKYB7wRPvWNHK2OxqPRj1vRJcrgNdSZPigUtxdutD3oisrVdakuOrBbA4HX1rb0tQ3npwpvSNwRjSGDD+eHUeSesWS9j/xC+oo2PL4tPiP1pRkQ6NJl04S36SmvhiJd0Om6C3Q8RoT9wfx5VSJ9Ph3paemfeCsSXLWC+rq/qlchj/d1RWgN2hyLdJ/O9d0UN9qusO0cFiUfjq0mg5aC9ani04SlzKL1lYreg2Cas4SXZQyR/NU6+TsZI/PiTzX229hz5kK+2/7yQqTn1f215aONqHgh0GLZoOcNTknTIauTt+/POKO4iZZ6LTKCf1O8hmtziuvsYZ9qVRKslu4oPYhvGNk68Le7xzSRE+H8kI98hjwnNEr9vWdo5/ljqObUEd2k4uvNBzPSQaOo9toOGbH3883z58=
Just observe TS errors on lines 6 and 12 of repro
Basically, toRef(MaybeRef<number>).value has this type Ref<T = any, S = T>.value: S = T instead of roughly number
toRef(MaybeRef<number>).value
Ref<T = any, S = T>.value: S = T
number
No TS errors
TS errors:
Type 'number' is not assignable to type 'S'. 'S' could be instantiated with an arbitrary type which could be unrelated to 'number'.ts(2322)
System: OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish) CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900H Memory: 26.21 GB / 31.19 GB Container: Yes Shell: 5.1.16 - /bin/bash Binaries: Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm pnpm: 9.4.0 - ~/.local/share/pnpm/pnpm Browsers: Chrome: 131.0.6778.264 npmPackages: vue: ^3.5.13 => 3.5.13
The issue seems to be resolved in TypeScript Version 5.4.0-beta and later.
The text was updated successfully, but these errors were encountered:
It can't reproduce with ts v4.9.5, see playground So it should be a ts bug and resolved in 5.4.0-beta and later.
Sorry, something went wrong.
Hey @edison1105 looks like playground link doesn't include TS version. I get reproduction with TS 5.1.6:
Which means that the latest Vue version should have peer dependency of TS 5.4.0-beta or later, IMO.
So please, reopen the issue, cheers!
ShallowRef
Successfully merging a pull request may close this issue.
Vue version
3.5.13
Link to minimal reproduction
https://play.vuejs.org/#eNrNVE2P2jAQ/SsjXwAJBQG7PbCA1FZ72ErdrXY5Wlo5yRBMEzuyHT5E+e8dO2xIBdr2Umkv0djz5s3zm9gH9rkso02FbMKmNjGydGDRVSXkQmUzzpzlbM6VLEptHBzA6Wdc9uG72McYIuM/FMERlkYX0CGyDldcJVpZB8WecmhQJTicNGVTVRUxmjnMfH13OBr37q5UjCgfGnbbNB7aBkUbkVdI0JvbT3cwGMBiXyJ06hYdkBaUdiCslZkScY5ECS5AXjqR/0CiqzyFGEGSAKGcFA5T2Eq3AqFAmFg6I8y+rtquZLI6l1TKYB7wRPvWNHK2OxqPRj1vRJcrgNdSZPigUtxdutD3oisrVdakuOrBbA4HX1rb0tQ3npwpvSNwRjSGDD+eHUeSesWS9j/xC+oo2PL4tPiP1pRkQ6NJl04S36SmvhiJd0Om6C3Q8RoT9wfx5VSJ9Ph3paemfeCsSXLWC+rq/qlchj/d1RWgN2hyLdJ/O9d0UN9qusO0cFiUfjq0mg5aC9ani04SlzKL1lYreg2Cas4SXZQyR/NU6+TsZI/PiTzX229hz5kK+2/7yQqTn1f215aONqHgh0GLZoOcNTknTIauTt+/POKO4iZZ6LTKCf1O8hmtziuvsYZ9qVRKslu4oPYhvGNk68Le7xzSRE+H8kI98hjwnNEr9vWdo5/ljqObUEd2k4uvNBzPSQaOo9toOGbH3883z58=
Steps to reproduce
Just observe TS errors on lines 6 and 12 of repro
Basically,
toRef(MaybeRef<number>).value
has this typeRef<T = any, S = T>.value: S = T
instead of roughlynumber
What is expected?
No TS errors
What is actually happening?
TS errors:
System Info
Any additional comments?
The issue seems to be resolved in TypeScript Version 5.4.0-beta and later.
The text was updated successfully, but these errors were encountered: