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.

Warning while building library

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

When we create a library named my-lib, angular cli adds the following to tsconfig.json:

  "my-lib": [
    "dist/my-lib/my-lib",
    "dist/my-lib"
  ]

When we build the library using ng build my-lib, we see the following warning several times in the console:

Warning: The basePath "/somepath/my-workspace/dist/my-lib/my-lib.d.ts" computed from baseUrl "/somepath/my-workspace" and path mapping "/somepath/my-workspace/dist/my-lib/my-lib.d.ts" does not exist in the file-system.
It will not be scanned for entry-points.

In the end, the build succeeds, but the warning is annoying. It was printed 9 time while building.

πŸ”¬ Minimal Reproduction

ng new my-workspace --create-application=false
cd my-workspace
ng generate library my-lib
ng build my-lib

🌍 Your Environment


Angular CLI: 9.1.0
Node: 13.12.0
OS: linux x64

Angular: 9.1.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.0
@angular-devkit/build-angular      0.901.0
@angular-devkit/build-ng-packagr   0.901.0
@angular-devkit/build-optimizer    0.901.0
@angular-devkit/build-webpack      0.901.0
@angular-devkit/core               9.1.0
@angular-devkit/schematics         9.1.0
@angular/cli                       9.1.0
@ngtools/webpack                   9.1.0
@schematics/angular                9.1.0
@schematics/update                 0.901.0
ng-packagr                         9.1.0
rxjs                               6.5.5
typescript                         3.8.3
webpack                            4.42.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
alan-agius4commented, Apr 9, 2020

@Annie-Huang, this has been closed as it was fixed via https://github.com/angular/angular/pull/36525

The fix will be available in 9.1.2

Yes, the above warning can be ignored.

2reactions
Roaderscommented, Apr 11, 2020

What confuses me is that I still get the warning when I move the paths from the base tsconfig to tsconfig.app.json. I don’t want the path mappings to be available to my library (I’ll just use relative paths), I only want it available to my app.

In fact. it still happens if I remove all paths from all tsconfig files???

Why do I still get the warnings?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lots of warnings when building with Xcode 7 with 3rd party ...
I am getting a large number of warnings when compiling my project in Xcode 7 GM (bitcode is NOT enabled) in regards to...
Read more >
Module never used warning while building Angular 9 library
Recently I updated one of my projects from Angular 8 to Angular 9. When I try to build the library IΒ ...
Read more >
Linker warning when building managed extension - Visual C++
This article provides information about resolving linker warnings when you build managed extensions for C++ DLL projects.
Read more >
Build Scripts - The Cargo Book
Other packages need to link to C libraries which can either be located on the ... When the build script is run, there...
Read more >
List of the armlink error and warning messages - Arm Developer
The linker can recognize object files in ELF format and library files in AR format. ... An I/O error occurred while creating the...
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