ng-packagr: UnhandledPromiseRejectionWarning on ng-packagr@2.0.0-rc.13

Type of Issue

[X] Bug Report
[ ] Feature Request

Description

1st

(node:54348) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '.ng_build/<library_name>/out/node_modules/license-webpack-plugin/dist/FileUtils.d.ts'

2nd

(node:48908) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, chmod '.ng_build/<library_name>/out/node_modules/ionic-angular/util/debouncer.d.ts'

3rd

(node:48800) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '.ng_build/<library_name>/out/node_modules/rxjs/operator/findIndex.d.ts'

Other logs

(node:54348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:54348) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with anon-zero exit code.

How To Reproduce

After my library update ng-packagr to version 2.0.0-rc.13, it always be built failed. Those error won’t be the same everytime. Downgrade to 2.0.0-rc.12 is fine.

Expected Behaviour

Can build my app

Version Information

ng-packagr: 2.0.0-rc.13
@angular/*: 5.0.3
typescript: 2.4.2
rxjs: 5.5.2
node: 9.4.0
npm/yarn: 5.6.0

please include any version information that might be relevant, e.g. other third-party libraries

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 25 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I don’t get the error once I move public_api.ts into the src directory. I’m not sure why the location matters, but it works for me.

@NeoLSN and others if you still have the issues.

I give another shot at moving again the public_api.ts into the src/ folder and it now works. The reason of why it wasn’t working before is quite silly from my side, I had forgot to update the pointer of the export within the public_api.ts since the folder structure changed.

Just to resume the steps, I did the following:

  1. move the public_api.ts into src/ folder
  2. update the entryFile in ng-package.json like so
    • "entryFile": "src/public_api.ts"
  3. update your exports inside the public_api.ts

Also note that after doing this changes, not only did it fixed the errors, the build runs much faster than before.

Same problem here with 2.0.0 as well.

I also get some of these errors, with version 2.2.0, but it still finishes the build and my package still end up working, so I didn’t care much.

However I tried the quick fix mentioned in the comments by moving the public_api.ts file into the ./src folder and I get other kind of errors and the build just stops. So it doesn’t look like this quick fix is good for all, am I the only one with that supposedly fix that doesn’t work?

@iamthechad I moved public_api.ts to src directory as well and the error is gone. Very strange.