Open
Description
Related plugins
Describe the bug
I am not exactly sure this is a bug of this plugin-in, sorry if this is not caused by this plugin-in.
Returning object of same name as standard object such as JSON
or Date
from setup
function sometimes overrides standard object and sometimes not.
Although I cannot reproduce, I have an environment overriding always occur.
Reproduction
https://stackblitz.com/edit/vitejs-vite-4y7scdda?file=src%2Fcomponents%2FHelloWorld.vue
Steps to reproduce
- Open the reproduction URL
- Open
src/components/HelloWorld.vue
and look side by side with resulting page view. We see;- The first paragraph displays
{{ JSON }}
, and theJSON
here is the object returned fromsetup
function. - The second paragraph displays
{{ JSON.toString() }}
, and theJSON
here is a standard object as can be seen from the resulting page shows[object JSON]
.
- The first paragraph displays
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@vitejs/plugin-vue: ^5.2.1 => 5.2.1
vite: ^6.2.0 => 6.2.0
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.