Skip to content

Angular 14 "ng build" breaks concurrent "ng serve" #24791

@hannobunjes

Description

@hannobunjes

Which @angular/* package(s) are the source of the bug?

common

Is this a regression?

No

Description

Consider a workspace with an application appand a library lib.

Run these commands

  1. Run ng build lib --configuration development --watch, wait until it finishes
  2. In another terminal, run ng serve app --configuration development, wait until it finishes
  3. End the ng build lib process (note: this becomes necessary when ng build cannot build incrementally and a restart is required to run a successful build)
  4. Repeat the command from step 1

Expected result is that ng serve continues working and uses the new version of lib.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Compiled with problems:X

ERROR

projects/app/...../module.ts:33:8 - error TS2307: Cannot find module 'lib' or its corresponding type declarations.

33 } from 'lib';
          ~~~~~

and many other errors all relating to the fact that qer cannot be found even though the library was successfully compiled to the dist/qer folder.
Restarting ng serve fixes the issue.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.2.10
Node: 14.21.1
Package Manager: npm 6.14.17
OS: win32 x64

Angular: 14.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions