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.

Browser doesn't reload after the local development server detected changes to the local code when developing an Angular Frontend

See original GitHub issue

Given a freshly created AEM 6.5.0 project, created with an Angular Frontend using Archetype Version 23 and default parameters…

Expected Behaviour

When executing npm run start from the ui.frontend module, the development server should reload on local changes (which is also stated in the generated README.md).

Actual Behaviour

The development server detects local changes, but the browser doesn’t reload and display them. Locally Webpacked Javascript Files are not included in the HTML while a couple of files from etc.clientlibs are.

In http://localhost:4200, after the redirect to /content/myapp/at/de/home.html, there is an include of <script type="text/javascript" src="/etc.clientlibs/myapp/clientlibs/clientlib-angular.js"></script> instead of the Webpack-Includes:

<script src="runtime.js" type="module"></script>
<script src="polyfills.js" type="module"></script>
<script src="styles.js" type="module"></script>
<script src="vendor.js" type="module"></script>
<script src="main.js" type="module"></script>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

1reaction
prashantonkar87commented, Apr 14, 2020

@mzellho Those are the only changes as far as I remember. As you pointed out in your first comment, the front-end app is pointing to AEM for all script. So, if my solution didn’t work, probably you would want to remove all references to your AEM (completely disabling proxy in your front-end is one option).

1reaction
prashantonkar87commented, Apr 3, 2020

I dont know why "/content/**/*" is proxied. I ended up doing following changes to make it work:

  1. Changed the proxy configuration : "context": ["/content/**/*.json", "/etc.clientlibs/**/*", "/libs/**/*"],
  2. In index.html in head tag added: <base href="/">
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular/CLI -- auto reload doesn't happen - Stack Overflow
The site is getting updated only when I terminate the "ng serve" command and again run the same command("ng serve") then only my...
Read more >
Why webpack-dev-server Live-Reload Is Not Working - Medium
This means that any code change, appears automagically and instantly on the browser. Here is what webpack-dev server actually does:.
Read more >
Browser support - Angular
Angular is built on the latest standards of the web platform. Targeting such a wide range of browsers is challenging because they do...
Read more >
Using Angular's Live Reload Web Server to Refresh Pages on ...
The problem is that by default the WebPack server is bound to localhost. localhost is the local loopback adapter or 127.0.0.0 which does...
Read more >
Automatically refresh the browser on Node / Express server ...
In the app.js file, three main changes must be done. ... var livereload = require("livereload"); var connectLiveReload = require("connect- ...
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