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
Electron - Node Integration = false, Production Build Fails #6893
Comments
Temporary Hack: node_modules@quasar\app\lib\quasar.conf.js
|
Cannot reproduce. But regardless, your changes don't actually make sense. They are essentially the same thing. Can you offer a reproduction repo pls? |
Came across this bug. It appears that the quasar-conf.js does not have access to node, so the URL needs to be set in electron. |
@rstoenescu, please find the reproduction repo here: I took some more deep diving, the issue does not pop up until i import the dependency 'request', which then seems to break the quasar webpack config generating the above error. Not sure if this should be happening but it is. |
Also by the way, using icon genie latest version on windows and electron builder default config settings in quasar.config.js, the build process is failing. As on windows "linux-512x512" image is not added by default in src-electron/icons/ folder and this seems to be the default requirement for electron builder. So if anyone has cleared the src-electron/icons and rebuilt the icons, they would have to copy the 512x512 image and rename it to "linux-512x512" for the build process to actually work on default config. |
I have come across the same |
@newCodeRunner Is this still an issue on QApp 2.0? |
I was just trying to upgrade from QApp 1.x to QApp 2.1 and got stuck with a similar error, don't know if it is related.
If I just set a value (true or false) instead of using |
I created an electron project from scratch and saw that now this |
@webnoob, I can too confirm this error. Once this is resolved, we would know more about the initial error. |
@newCodeRunner Check @pdanpdan commits above. Use: |
@newCodeRunner Just to clarify, his PR correctly documents how it should be done. It still needs changing in your source code. |
@webnoob and @pdanpdan, there is one new error appearing though. With Only happens in production env. Should I open a new issue for that?
The renderer now throws the following error:
|
@newCodeRunner yes, please open another issue |
Docs PR merged and now live. |
Describe the bug
Using Quasar Electron Mode: with Node Integration False fails on production build using electron-builder.
The dev version works and loads fine, but on production build, i get the following error:
Uncaught ReferenceError: __dirname is not defined
at Object. (vendor.js:formatted:60347)
Diving Deeper:
The error is initiated at line APP_URL, I suspect this is a webpack config error, since for the same project and same code, SPA build (both prod and dev) works just fine.
Also, the main process and renderer process both do not throw any error, the problem just lies in the vendors.js chunk emitted for the app itself.
Also another project initiated some time before (earlier versions) used to work fine too.
What does not work
Setting up same env variable in quasar.conf.js with blank JSON string to overwrite the default value.
Expected behavior
Should probably extend SPA config without modification on Node Integration = False.
Platform (please complete the following information):
OS: Win 10.0.17134
Yarn: 1.22.4
Browsers: Chrome 81.0.4044.122
Electron: 8.2.3
Electron-Builder: 22.5.1
The text was updated successfully, but these errors were encountered: