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
What I expect is consistent behavior between dev and build. Currently, I have to add a runtime check to account for the differences between dev and build environments:
What appears to be happening is during dev this is set to {} - during build this is set to window. This causes an if statement to become true in one environment but not the other, which needs to be corrected with a runtime check, else an error will occur.
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.
I would argue that this is a vite issue, and not an upstream issue, as vite is the thing bringing esbuild and rollup together. As it stands, one is not able to be sure what they are seeing during dev will be reflected once they build.
I think that's the big issue for me - if it broke in the same way during both dev and build it'd be easier to account for.
Describe the bug
I am using a package called
rails-ujs
.What I expect is consistent behavior between dev and build. Currently, I have to add a runtime check to account for the differences between dev and build environments:
What appears to be happening is during dev
this
is set to{}
- during buildthis
is set towindow
. This causes an if statement to become true in one environment but not the other, which needs to be corrected with a runtime check, else an error will occur.Reproduction
https://github.com/gecugamo/vite-debugging/tree/main
Steps to reproduce
Compare app functionality during dev mode and build mode.
Setup
Run
npm i
Dev
npm run dev
Build
npm run build && npm run preview
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: