Home > Enterprise >  HTML loads, but scripts don't run
HTML loads, but scripts don't run

Time:01-08

I've this script compiled through Parcel:

enter image description here

CodePudding user response:

In your build.js file replace the target option with web instead of electron.

UPDATE: I actually found a better solution to your problem as you may need to use the right target at some time in your application. See below:

The issue is that nodeIntegration isn't enabled on your BrowserWindow although you specified it in the options. This is because contextIsolation is on by default and those two options cannot work together. Adding contextIsolation: false inside webPreferences when building your window should also fix your issue while keeping the parcel target to electron.

  •  Tags:  
  • Related