Comments (13)
For people who still have this issue, do a force app load if failed:
win.webContents.on('did-fail-load', () => win.loadURL(...));
from angular-electron.
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.
from angular-electron.
I think I’m having the same issue, is this the only solution? It would be nice to be able to configure electron to work with html5 location strategy (angular’s default)
from angular-electron.
Yes... Is there any other solution for this to make things work with angular's default strategy
from angular-electron.
@CPrescher You are right. The base-href
should be declared with /
in order to use both routing strategies (with or without fragments) with hot reload.
By the way routing doesn't seems to work when the app is encapsulate in an electron executable when base-href
is set to /
(after running electron:local
or electron:linux
or electron:windows
or electron:mac
).
To make it works, I had to set --base-href ./
in npm build
script.
I also added another page module to check that the routing is correctly working.
from angular-electron.
For people who still have this issue, do a force app load if failed:
win.webContents.on('did-fail-load', () => win.loadURL(...));
This will work, but you will loose the value of the variable because your app will be restarting. So if you need a log-in screen before you're able to run the electron app, be sure to store the value in the localStorage
or somewhere else
@maximegris
Adding the --base-href ./
make my app loose the location to the assets
folder. did you had the same problem ? If yes could you find a fix?
from angular-electron.
Thanks for this report !
I pushed the fix.
Regards
from angular-electron.
Had the same issue working with electron & angular 7, this solved for me.
from angular-electron.
2019 still working dude
Ng8
from angular-electron.
Great, thank you for making this change so fast.
from angular-electron.
You're welcome :)
from angular-electron.
Is webpack supposed to reload the renderer when you change angular-related code? I'm not seeing webpack attempt to recompile anything when I change an html file.
from angular-electron.
Also cannot get this to work. my stack:
@ionic/[email protected]
@ionic-native/[email protected]
@capacitor/[email protected]
[email protected]
[email protected]
Had to employ the {useHash: true} option as well as set to get manual reload working via ctrl+R. electron-reload itself never works on this stack.
If I add it top of Electron's index.js file (Capacitor renamed main.js to index.js) as per the example on the main page of this repo, then on every detected change the cursor starts flickering and an endless spinning circle appears next to the cursor until I close the Electron window...
any idea how to fix this ? would love to have auto-reloads in Electron browser...
from angular-electron.
Related Issues (20)
- Unable to run ngx-monaco-editor with electron HOT 1
- Error: Module not found: Error: Can't resolve 'fs' HOT 3
- Any way to update form angular-electron 13 to 16 HOT 1
- Cannot install angular material HOT 2
- A JavaScript error occurred in the main process HOT 1
- Open link start with "#" on Angular HOT 1
- New window HOT 1
- Karma is now deprecated, what's next? HOT 2
- Firebase Not working in desktop app while it's working in (Web Serve & Build) HOT 2
- How to setup findInPage?
- Loading preload scripts HOT 1
- Notification Mini Icon on window
- Kinectron HOT 2
- Electron Builder for windows: Icon Paths Not Translated with Macro in Output Directory HOT 1
- How can I change the splash screen image? HOT 4
- What about esbuild? HOT 3
- [Bug]: failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID when connect mqtt with ca certificate
- What about Nrwl NX? HOT 2
- [Bug]: Application gives blank white screen when tried to reload HOT 2
- Add DesktopCapturer to ElectronService HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-electron.