Skip to content

fix: can't access property "size", store._customProperties is undefined #3004

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

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

Conversation

TimvdEijnden
Copy link

@TimvdEijnden TimvdEijnden commented Jul 15, 2025

When using Pinia module in the Vue dev tools in Firefox (Zen browser) and I select a store the following error occurs, it is fixed by checking if store._customProperties exists.

Screenshot 2025-07-15 at 13 48 36

When I set a breakpoint and set store._customProperties to a new Map() it seems to work.

Screenshot 2025-07-15 at 13 48 21

Copy link

netlify bot commented Jul 15, 2025

Deploy Preview for pinia-official canceled.

Name Link
🔨 Latest commit 627de5c
🔍 Latest deploy log https://app.netlify.com/projects/pinia-official/deploys/687646277d2fb300089caa4d

@posva posva added the need repro This issue couldn't be reproduced label Jul 15, 2025
@posva posva marked this pull request as draft July 15, 2025 12:49
@posva
Copy link
Member

posva commented Jul 15, 2025

do you have a repro?

@TimvdEijnden
Copy link
Author

TimvdEijnden commented Jul 15, 2025

I can reproduce it on https://www.jumbo.com but I can try create a separate one if really needed

@posva
Copy link
Member

posva commented Jul 15, 2025

Yes, please, a repro must be minimal

@TimvdEijnden
Copy link
Author

@TimvdEijnden TimvdEijnden marked this pull request as ready for review July 16, 2025 08:03
Copy link
Member

posva commented Jul 16, 2025

thanks! That's quite weird, I suppose it goes away if you use the nuxt devtools?
Regarding the PR, this shouldn't be the fix as the _customProperties should always be defined, so if you want to push this forward, you will need to dig a bit deeper into the problem. Thanks!

@TimvdEijnden
Copy link
Author

TimvdEijnden commented Jul 16, 2025

Here you see the _customProperties only added in case __DEV__ || (__USE_DEVTOOLS__ && IS_CLIENT) and that is false in this scenario.

const store: Store<Id, S, G, A> = reactive(
    __DEV__ || (__USE_DEVTOOLS__ && IS_CLIENT)
      ? assign(
          {
            _hmrPayload,
            _customProperties: markRaw(new Set<string>()), // devtools custom properties
          },
          partialStore
          // must be added later
          // setupStore
        )
      : partialStore
  ) as unknown as Store<Id, S, G, A>

I only wanted to get rid of the error, not sure what the best best appoach is to fix it since the app is running production mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need repro This issue couldn't be reproduced
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants