Unable to load preload script with latest package @vercel/[email protected]
Pre-flight checklist
- [x] I have read the contribution documentation for this project.
- [x] I agree to follow the code of conduct that this project uses.
- [x] I have searched the issue tracker for a bug that matches the one I want to file, without success.
Forge version
7.8.1
Electron version
v36.5.0
Operating system
Windows 11 企业版 LTSC
Last known working Forge version
7.8.1
Expected behavior
renderer with no error
Actual behavior
renderer with error in electron window dev tool, and window is blank
VM4 sandbox_bundle:2 Unable to load preload script: C:\Users\AI\Desktop\ai-learning-assistant-launcher\.webpack\renderer\main_window\preload.js
executeSandboxedPreloadScripts @ VM4 sandbox_bundle:2
VM4 sandbox_bundle:2 ReferenceError: __dirname is not defined
at <anonymous>:389:84
at <anonymous>:1412:12
at runPreloadScript (VM4 sandbox_bundle:2:144346)
at executeSandboxedPreloadScripts (VM4 sandbox_bundle:2:143619)
at VM4 sandbox_bundle:2:154017
at VM4 sandbox_bundle:2:154219
at ___electron_webpack_init__ (VM4 sandbox_bundle:2:154223)
at VM4 sandbox_bundle:2:154346
executeSandboxedPreloadScripts @ VM4 sandbox_bundle:2
index.js:33520 Uncaught ReferenceError: __dirname is not defined
at index.js:33520:84
at index.js:34614:12
VM4 sandbox_bundle:2 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.
warnAboutInsecureCSP @ VM4 sandbox_bundle:2
Steps to reproduce
git clone https://github.com/ai-learning-assistant-dev/ai-learning-assistant-launcher.git
git checkout - b shiftonetothree_dev origin/shiftonetothree_dev
npm i
nom i @vercel/webpack-asset-relocator-loader@latest
npm run start
Additional information
No response
I tried to upgrade from 1.7.0 to 1.10.0 and I now get the same error in my project. I have downgraded back to 1.7.0 for now.
@viemmsakh yes, it's only work on not bigger than 1.7.3
We specifically monkeypatch that package to work with Electron Forge. Is there a reason you want to install 1.10.0?
We specifically monkeypatch that package to work with Electron Forge. Is there a reason you want to install 1.10.0?
npm auto upgrade my @vercel/webpack-asset-relocator-loader
downgrade to 1.7.3 worked for me