简体   繁体   中英

Hot Reload shows blank screen in Electron Svelte with svelte-routing

I am working on an Electron.js application, utilizing Svelte as my frontend framework.

I'm using hot reload with chikidar, but every time I reload it shows a white blank screen, and I get an error in the devtools: Not allowed to load local resource: file:///

I think this is because I use the svelte-routing package, and do something wrong with it. When I first start the app, the window location is: file:///path/to/project/public/index.html , but after the first svelte-routing link is used, it changes to: file:/// .

What am I doing wrong?

Because it's an electron app, url doesn't really matter, I store the current page name in a Svelte store, and I have an if-else block for choosing which page to display

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM