DarkGuy10 / NextJS-Electron-Boilerplate

A boilerplate for building desktop apps with Electron and NextJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

CrazyChildren opened this issue · comments

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

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