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

Types for classes extending Maps or Set "lose" methods/properties added in those classes after unwrapping #9852

Closed
daddz opened this issue Dec 16, 2023 · 4 comments · Fixed by #9854

Comments

@daddz
Copy link

daddz commented Dec 16, 2023

Reproduction

https://play.vuejs.org/#eNp9UU1vwjAM/StWLoCEyoFbV5A2xGGT9qFtx1yq1pSyNInyUZCq/vc56Vo4TEg5xM/287Nfxx61TlqPLGWZLUytHVh0XoPIZbXhzFnOtlzWjVbGQQcG88LVLS7pd4AeDkY1MCOC2QOXXBYitxZ23jrVvOYa8OJQlhbCv+MS4IhCqPkiBetMLasBBCJz3kiYxfQsYD2X9IhRSUuanDIIm2n8PPYV45wUJJ6vY+eLJXUvQnu2GraiHShw2GiRO6QIICvrdtt1A3cycSV/EqHvs1UoCSRTI1vSSUjToa6Sk1WS7halcFaoRtcCzbt2NWnmLB2X4ywnxvNLxJzxSOoGvDhi8fMPfrKXgHH2YdCiaZGzKedyU6Eb0vuvN7rwTbJRpRdUfSf5iVYJHzQOZU9eliT7pi6qfY6Ok0Xfdh9MtONSQWg0KNZzRt7v7qx+lbtO1qOxrP8F6AnVqQ==

Steps to reproduce the bug

  1. Set vue version to 3.3.10 or above
  2. Set vue version to 3.3.9

Expected behavior

It should still be working with vue 3.3.10+

Actual behavior

It will throw the following error when using vue 3.3.10+
Property 'hello' does not exist on type 'Map<any, any>'.ts(2339)

@posva posva transferred this issue from vuejs/pinia Dec 16, 2023
@posva
Copy link
Member

posva commented Dec 16, 2023

I transferred this with a vue only repro as I couldn’t find any similar issue here

@daddz
Copy link
Author

daddz commented Dec 16, 2023

Thanks for looking into this! I extended your reproduction with a few more examples: play.vuejs.org

It seems that atleast all types in https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.collection.d.ts are affected

@LinusBorg
Copy link
Member

Seems to be from this change:

#8960

@posva
Copy link
Member

posva commented Dec 16, 2023

Ah, I see. We can get a working version with some more complex types but I wonder if it won't creates other problems down the line.

@LinusBorg LinusBorg changed the title Type inference broken with defineStore and vue 3.3.10+ types for classes extending Maps or Set "lose" methods/properties added in those classes when but in ref/reactive Dec 17, 2023
@LinusBorg LinusBorg changed the title types for classes extending Maps or Set "lose" methods/properties added in those classes when but in ref/reactive Types for classes extending Maps or Set "lose" methods/properties added in those classes Dec 17, 2023
@LinusBorg LinusBorg changed the title Types for classes extending Maps or Set "lose" methods/properties added in those classes Types for classes extending Maps or Set "lose" methods/properties added in those classes after unwrapping Dec 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants