question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron reload not working

See original GitHub issue

Hi. First of all thanks for this great repository. Im pretty new working with Angular 4 so this problem may be because of that. The issue is that live reloading my app after changes in the code are done is not possible until i change app-routing.module.ts to this:

@NgModule({
    imports: [RouterModule.forRoot(routes, {useHash: true})],
    exports: [RouterModule]
})

Also i had to change index.html base href tag to be empty: <base href=""> all this to tell angular to work with hashbang style routes instead of html5 style routes.

The solution came from here.

¿is this the right solution or i’m missing something?

Thanks in advance, gr33ts from Chile.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:17
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
mariotakucommented, May 28, 2021

For people who still have this issue, do a force app load if failed:

win.webContents.on('did-fail-load', () => win.loadURL(...));
2reactions
CPreschercommented, Apr 20, 2020

The change to <base href=''> actually breaks reloading right now for routing without useHash=true.

It adds to every URL an extra backslash which cannot be resolved by the router e.g. it goes from “file” to “file/” which is quite annoying and it is hard to find out why this is happening.

I checked with electron and the reload seems to work for hashing and without it with the <base href='/'> at least for angular 9

Since the latest version of this repo is supporting angular 9, would it be possible to change the base element back, since there is no need for the href='' anymore and it only will provide confusion for future users who also do not want to use hashing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron App -- Electron reload not working - Stack Overflow
reload to work on my window's Browserview. They perfectly work on the main body of the browser window, but the browser view that...
Read more >
How can I do refresh in electron html app #11895 - GitHub
How can I do refresh in electron html app ? I have window without menu and I wan to let user to refresh...
Read more >
electron-reload - npm
Simplest way to reload an electron app on file changes!. Latest version: 2.0.0-alpha.1, last published: a year ago.
Read more >
Hot Reload in ElectronJS - GeeksforGeeks
This tutorial will demonstrate how to implement hot reloading in Electron using electron-reload npm package and electron-reloader npm package.
Read more >
electron-reload - npm Package Health Analysis - Snyk
The npm package electron-reload was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found