Problem in a multiple library repo: can't inter-depend on each other
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
If I create a repo made of two libraries for which one depends on the other I can’t figure out how to package the one that depends on the other. I get the error shown below.
How To Reproduce
I have a repo setup here. The libraries are in the packages folder. Note that ng-date-utils depends on ng-utils. But I get this error trying to package ng-date-utils.
cuervomovil:au-ng ken$ node_modules/.bin/ng-packagr -p packages/ng-date-utils/ng-package.json
Building Angular library
Generating bundle for @animalus/ng-date-utils
Cleaning bundle build directory
Processing assets
Running ngc
BUILD ERROR
Error at /Users/ken/dev/animalus/au-ng/packages/ng-date-utils/.ng_pkg_build/@animalus-ng-date-utils/ts/src/dateUtils.service.ts:10:27: Cannot find module '../../ng-utils/public_api'.
Error at /Users/ken/dev/animalus/au-ng/packages/ng-date-utils/.ng_pkg_build/@animalus-ng-date-utils/ts/src/module.ts:4:23: Cannot find module '../../ng-utils/public_api'.
Error at /Users/ken/dev/animalus/au-ng/packages/ng-date-utils/.ng_pkg_build/@animalus-ng-date-utils/ts/ng-date-utils.ts:7:45: Cannot find module '../ng-utils/public_api'.
Error: Error at /Users/ken/dev/animalus/au-ng/packages/ng-date-utils/.ng_pkg_build/@animalus-ng-date-utils/ts/src/dateUtils.service.ts:10:27: Cannot find module '../../ng-utils/public_api'.
Error at /Users/ken/dev/animalus/au-ng/packages/ng-date-utils/.ng_pkg_build/@animalus-ng-date-utils/ts/src/module.ts:4:23: Cannot find module '../../ng-utils/public_api'.
Error at /Users/ken/dev/animalus/au-ng/packages/ng-date-utils/.ng_pkg_build/@animalus-ng-date-utils/ts/ng-date-utils.ts:7:45: Cannot find module '../ng-utils/public_api'.
at new UserError (/Users/ken/dev/animalus/au-ng/node_modules/ng-packagr/node_modules/@angular/tsc-wrapped/src/tsc.js:27:28)
at check (/Users/ken/dev/animalus/au-ng/node_modules/ng-packagr/node_modules/@angular/tsc-wrapped/src/tsc.js:93:15)
at Tsc.typeCheck (/Users/ken/dev/animalus/au-ng/node_modules/ng-packagr/node_modules/@angular/tsc-wrapped/src/tsc.js:173:9)
at /Users/ken/dev/animalus/au-ng/node_modules/ng-packagr/node_modules/@angular/tsc-wrapped/src/main.js:122:23
at <anonymous>
Expected Behaviour
please describe what behaviour or result you expected
Version Information
ng-packagr: v1.x.y
node: v8.x.y
@angular: v4.x.y
rxjs:
zone.js:
please include any version information that might be relevant, e.g. other third-party libraries
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Git Repository Structure for Interdependent Projects
The problem here is the Library Collection repository. This includes a few dozen libraries at the moment, but continues to grow at an ......
Read more >Dependency hell - Wikipedia
The dependency issue arises when several packages have dependencies on the same shared packages or libraries, but they depend on different and incompatible ......
Read more >How to create interdependent gems with bundler, and use ...
1 Answer 1 ... Bundler is warning you that your gems have a circular dependancy. Namely library-a depends on library-b and the other...
Read more >Git and Project Dependencies | Atlassian Git Tutorial
Dependencies are an important aspect of software development. Allows you to manage the versions of other libraries used by your code. Read and...
Read more >Why don't you have a monorepo? - Packt Hub
Many people conclude it must only solve problems the likes of Google and ... With each service and library being in a separate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using the programmatic API, we are able to package the libraries in order, and during the packaging we are able to use the already packaged libraries. This packaging process uses a custom tsconfig that looks for the libraries in the place they are packaged to. The order of packaging is very important, as the libs with dependencies must package after the dependecies have finished packaging. Something like:
Please check the ngPackagr code for the exact API here: https://github.com/dherges/ng-packagr/blob/v2.4.1/src/lib/ng-v5/packagr.ts
Hi guys is possible avoid the use of link?
i find out a plugin for rollup that could avoid this thing:
https://www.npmjs.com/package/rollup-plugin-paths
but I am not sure if there is a way to include plugin in ng-packagr , someone knows if is something possible?