-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use new decorators in vue with vite and babel #9560
Labels
Comments
How would I know which version this fix will be released in? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.3.8
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-cbe6hz
Steps to reproduce
Build the given reproduction using
npm run build
and see this error:Even though in vite.config.ts, the vue plugin's config lists the
decorators
babel plugin, it is not being considered in the following code.The following code seems to be the cause of it: https://github.com/vuejs/core/blob/main/packages/compiler-sfc/src/script/context.ts#L167.
Since it is never checked if user has passed the decorators plugin before adding the decorators-legacy one, both the plugins end up being pushed in the array
What is expected?
no error on build
What is actually happening?
Error on build
System Info
Any additional comments?
It seems like the
plugins
array check to see if it includes 'decorators' is a mistake, since that will always come out to be true. It should check in theuserPlugins
array insteadThe text was updated successfully, but these errors were encountered: