umunBeing
umunBeing

Reputation: 661

Angular 12 Library Builds Fails with error [object Object]

I have been trying to build this library in angular 12. But the only error message I get is [object Object]. What could I try to debug the problem?

> nx run user-pref:build:production 
> Building Angular Package

> ------------------------------------------------------------------------------
> Building entry point '@umn/user-pref'
> ------------------------------------------------------------------------------
> ✖ Compiling with Angular sources in Ivy partial compilation mode.
> [object Object]
> 
>  NX   ERROR  Running target "user-pref:build" failed

Upvotes: 1

Views: 2236

Answers (2)

Thomas
Thomas

Reputation: 91

I had the same error in my project and after days of debugging and investigation, I found this issue on github, which exactly described my problem:

it turned out the error can be triggered by generating a lib and changing its name >in the inline package.json from @org/a/b/c to @org/a-b-c without adjusting the >paths in tsconfig.base.json

It is really annoying, thant no meaningful error is printed to the console!

Upvotes: 2

umunBeing
umunBeing

Reputation: 661

After days of debugging I finally found the reason.

A component in the library was importing a file from another library using its file location '../../../file.ts' instead of @library-name/file.

Upvotes: 4

Related Questions