vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.66k stars 6.2k forks source link

New Vite 2.5.x breaks Vuex-ORM package #4636

Closed mllull closed 3 years ago

mllull commented 3 years ago

Describe the bug

With upgrading Vite from 2.4.4 to 2.5.0 (even with beta.0), the Vuex-ORM package stopped working as expected.

The issue is on Vuex-ORM model fields, it loses all fields except $id.

I already know that Vuex-ORM is an external package from Vute/Vite.

Reproduction

Using Vite 2.4.4, it works as expected: https://codesandbox.io/s/spring-https-vn0nt

Using Vite 2.5.0, you can see that no items from models are shown: https://codesandbox.io/s/wandering-shadow-emfn2

System Info

System:
    OS: Linux 5.13 Arch Linux
    CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
    Memory: 6.25 GB / 15.54 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    Yarn: 1.22.11 - /usr/bin/yarn
    npm: 7.20.0 - /usr/local/bin/npm
  Browsers:
    Chromium: 92.0.4515.131
    Firefox: 91.0
  npmPackages:
    @vitejs/plugin-vue: ^1.3.0 => 1.4.0 
    vite: 2.4.4 => 2.4.4

Used Package Manager

yarn

Logs

No response

Validations

haoqunjiang commented 3 years ago

Please add "useDefineForClassFields": false to compilerOptions in the tsconfig.json.

mllull commented 3 years ago

@sodatea Thanks!! Now it's working :blush: