Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

custom formatter doesn't print ref value properly #12946

Open
mrleblanc101 opened this issue Feb 25, 2025 · 2 comments · May be fixed by #12948
Open

custom formatter doesn't print ref value properly #12946

mrleblanc101 opened this issue Feb 25, 2025 · 2 comments · May be fixed by #12948

Comments

@mrleblanc101
Copy link

Vue version

3.5.13

Link to minimal reproduction

https://stackblitz.com/edit/github-ugyyhuvm?file=components%2FHelloWorld.vue

Steps to reproduce

Is this a regression ?
I have a very simple store that export an hardcoded user object.

I added this to my component:

const store = useAuthStore();
const { user } = storeToRefs(store);
console.log(user);
console.log(user, user.value);

The first console.log is undefined.
The second one is not:

Ref<undefined>
Ref<Object>, Reactive<Object>

What is expected?

console.log(user); alone should return Ref<Object>.

What is actually happening?

console.log(user); returns Ref<undefined>.

System Info

System:
    OS: macOS 15.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 2.34 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
  Browsers:
    Chrome: 133.0.6943.127
    Chrome Canary: 135.0.7035.0
    Edge: 133.0.3065.82
    Safari: 18.3
    Safari Technology Preview: 18.2
  npmPackages:
    vue: latest => 3.5.13

Any additional comments?

No response

@mrleblanc101
Copy link
Author

Relates to vuejs/pinia#2920

@edison1105
Copy link
Member

edison1105 commented Feb 26, 2025

minimal reproduction

@edison1105 edison1105 changed the title console.log(user) returnsRef<undefined>, butconsole.log(user, user.value) return Ref<Object>, Reactive<Object> custom formatter doesn't print ref value properly Feb 26, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants