Skip to content
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

Vue flags not working correctly #12549

Closed
rstoenescu opened this issue Dec 13, 2024 · 2 comments
Closed

Vue flags not working correctly #12549

rstoenescu opened this issue Dec 13, 2024 · 2 comments

Comments

@rstoenescu
Copy link

rstoenescu commented Dec 13, 2024

Vue version

3.5.13

Link to minimal reproduction

https://github.com/rstoenescu/vue-flags-bug

Steps to reproduce

Please see the reproduction repo (a barebones Vitejs project folder): /vite.config.js for flags configuration and /src/App.vue for an Options API component.

define: {
  // No effect, it's still included
  __VUE_OPTIONS_API__: 'false',

  // Has the opposite effect: devtools will be enabled for prod builds!
  // Commenting this out will disable devtools in prod builds.
  __VUE_PROD_DEVTOOLS__: 'false',

  // Has the opposite effect: mismatch details will be included in prod builds!
  __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
},
  1. Run yarn build then serve the /dist folder. App.vue, which is an Options API component runs fine and executes its Options API definition.
  2. Run yarn build with vite.config.js > __VUE_PROD_DEVTOOLS__: 'false',. Serve the /dist folder and notice that Vue Devtools is available and running. Then again with the vite.config.js __VUE_PROD_DEVTOOLS__ line commented out. Notice that Vue Devtools is not available.

What is expected?

  1. Options API to not be included when define > __VUE_OPTIONS_API__ is set to false.
  2. Vue Devtools not to be available for production builds when define > __VUE_PROD_DEVTOOLS__ is set to false.
  3. Hydration mismatches will still be available in production builds when define > __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is set to false.

What is actually happening?

Following the configuration from my reproduction repo:

  1. Options API is still running fine. No build errors also.
  2. Vue Devtools are available in production builds.
  3. Hydration mismatches are still be available in production builds.

System Info

No response

Any additional comments?

No response

@KazariEX
Copy link
Contributor

KazariEX commented Dec 13, 2024

@edison1105
Copy link
Member

It's a vite-plugin-vue bug, see vitejs/vite-plugin-vue#480

@edison1105 edison1105 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants