-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Closed
Copy link
Labels
angular/build:applicationarea: @angular-devkit/build-angulardevkit/build-angular:dev-serverfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelytype: bug/fix
Description
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
16.2.10
Description
The new application builder does not live reload changes to linked libraries using npm link
In order to make it work for now, revert to the old builder. For a new project, change @angular-devkit/build-angular:application to @angular-devkit/build-angular:browser and "browser": "src/main.ts", to "main": "src/main.ts", in angular.json.
Minimal Reproduction
Firstly, create a new library using terminal
ng new lib-workspace --no-create-application
cd lib-workspace
ng generate library my-lib
ng build
cd dist/my-lib
npm link
cd ../..
ng build --watchStart another terminal
# Use SCSS and no SSR
ng new application-with-lib
cd application-with-lib
npm link my-libReplace app.component.ts
import { Component } from '@angular/core';
import { MyLibComponent } from 'my-lib';
@Component({
selector: 'app-root',
standalone: true,
imports: [MyLibComponent],
template: '<lib-my-lib></lib-my-lib>'
})
export class AppComponent {
}Add preserveSymlinks = true to angular.json
"projects": {
"application-with-lib": {
...
"architect": {
"build": {
...
"options": {
"preserveSymlinks": true,
...
}Run the app
ng serveNow change something in your library's my-lib.component.ts. Result is that no changes are reflected in your browser.
Exception or Error
No response
Your Environment
Angular CLI: 17.0.5
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64
Angular: 17.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1700.5
@angular-devkit/build-angular 17.0.5
@angular-devkit/core 17.0.5
@angular-devkit/schematics 17.0.5
@schematics/angular 17.0.5
ng-packagr 17.0.2
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.2
Anything else relevant?
No response
bassie1978, leo6104 and knackstedt
Metadata
Metadata
Assignees
Labels
angular/build:applicationarea: @angular-devkit/build-angulardevkit/build-angular:dev-serverfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelytype: bug/fix