DarkGuy10 / NextJS-Electron-Boilerplate

A boilerplate for building desktop apps with Electron and NextJS.
MIT License
52 stars 13 forks source link

Error in import CSS, image files because CORS when build app #56

Closed CrazyChildren closed 8 months ago

CrazyChildren commented 8 months ago

NextJS-Electron-Boilerplate is really a nice template for start. however, I notice a error when use yarn build, style sheet and image file seems not loaded correctly. But it load correctly when debug using yarn start. And it occured in yarn frontend:build, and it seems is caused by browser's CORS, the reference link of css and image is started with file// which is not allowd with CORS.

some mention add webSecurity: false, in BrowserWindow webPreferences would address this problem, but it don't works for me.

how to reproduce:

  1. clone the repo
  2. yarn install
  3. yarn build
  4. open app directly

platform

macOS x86

DarkGuy10 commented 8 months ago

@CrazyChildren This should now be fixed in v2.2.1, please give it a try!