Skip to content

Inconsistent behavior overriding standard object #539

Open
@silane

Description

@silane

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

  1. Open the reproduction URL
  2. Open src/components/HelloWorld.vue and look side by side with resulting page view. We see;
    • The first paragraph displays {{ JSON }}, and the JSON here is the object returned from setup function.
    • The second paragraph displays {{ JSON.toString() }}, and the JSON here is a standard object as can be seen from the resulting page shows [object JSON].

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions