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

<script setup> has different behavior between dev and build #10537

Closed
7 tasks done
NeilMcEachin opened this issue Oct 19, 2022 · 1 comment
Closed
7 tasks done

<script setup> has different behavior between dev and build #10537

NeilMcEachin opened this issue Oct 19, 2022 · 1 comment
Labels
bug: upstream Bug in a dependency of Vite

Comments

@NeilMcEachin
Copy link

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 run npm run build and npm run preview those no longer or defined inside options api

Reproduction

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 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

System Info

This is running inside stackblitz

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^3.1.2 => 3.1.2 
    vite: ^3.1.6 => 3.1.8

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

This is an upstream issue.
vuejs/core#6248

@sapphi-red sapphi-red added bug: upstream Bug in a dependency of Vite plugin: vue and removed pending triage labels Oct 20, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite
Projects
None yet
Development

No branches or pull requests

2 participants