You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I define variables in <script setup> they are available inside the options api when working with npm run dev but if I run npm run build and npm run preview those no longer or defined inside options api
run project with npm run dev
noticed on mounted count logs 0
notice watchedCount can watch count and is reactive on page
kill server and run npm run build and npm run preview
noticed on mounted count logs undefined
notice watchedCount cannot watch count and remains 0 when button clicked
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
If I define variables in <script setup> they are available inside the options api when working with
npm run dev
but if I runnpm run build
andnpm run preview
those no longer or defined inside options apiReproduction
https://stackblitz.com/edit/vitejs-vite-k5wxvd?file=src%2FApp.vue&terminal=dev
Steps to reproduce
run project with
npm run dev
noticed on mounted
count
logs 0notice
watchedCount
can watch count and is reactive on pagekill server and run
npm run build
andnpm run preview
noticed on mounted
count
logs undefinednotice
watchedCount
cannot watchcount
and remains 0 when button clickedSystem Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: