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
Defaults for define in main are causing esbuild error due to process.env not being a valid value #5
Comments
I can't reproduce this bug ( In Vite, the string replacement is done by itself, the |
Ok, seems like this error happens only when I remove
line in the config. I was building without this external declaration, because I wasn't sure for its need, but possibly it shouldn't be ever removed. |
Well, adding toolkit/utils to my larger project didn't fix the issue, but it does make a difference in Note that it uses the alpha version of vite (which currently is conflictinhg with I was able to workaround the problem in my project by commenting out contents of Line 33 in c71d5aa
so the real question is if those defines are some kind of obsolete feature, do we still need it in the plugin. |
@kskalski Thanks for taking the time to reproduce the issue. I will try it too. Whether this feature is still needed, we should really think about it 🤔 . |
use vite@3 now |
Describe the bug
I'm getting error
which can be bypassed by adding
define
, that replaces those keys with something else like single identifier or{}
. However for main process I do actually want to useprocess.env
, which appears to be not possible to do now (I suspect newest esbuild introduced some stricter checks that the value is single identifier or valid JSON, butprocess.env
is neither, see evanw/esbuild#2292).I think for
main
section we shouldn't actually use the define at all, since we are replacingprocess.env
withprocess.env
, which doesn't make a lot of sense and those references could be left as they are in the emitted code.Electron-Vite Version
1.0.3
Electron Version
18
Vite Version
v3.0.0-alpha.8
Validations
The text was updated successfully, but these errors were encountered: