Open pauloevpr opened 3 years ago
I'm also running into this issue. The work around would be to set the property in the created lifecycle hook, but I'm also concerned about why this is different behaviour from webpack.
Setting useDefineForClassFields: false
in tsconfig compilerOptions like proposed here solved it for me
Reproduction repo: https://github.com/pauloevpr/reproduction-vite-plugin-vue-2-props-issue
When defining props using the
@Prop
decorator fromvue-property-decorator
, the props are undefined during the component's initilization when running in Production.If you take for instance the following class component:
When the component is rendered, the following output will appear on the console:
The expected output should be:
The issue only happens:
vite build
;Packages and Versions: