I leave the repository if someone wants to see it better: https://github.com/AyuDiego/my-lib-project
#Angular 17 standalone components in a library dependency problem
15 messages · Page 1 of 1 (latest)
Angular 17 standalone components in a library dependency problem
Why do you have all these src folders and ng-package.json and index.ts and public-api.ts files? You should just have the top-level ones, and list all the components in the single, top-level public-api.ts file, and use relative paths for your imports.
I saw it in an example that they do it like that, but you're right, I'm going to try as you say.
u said @zealous trout like these no?
use relative paths for your imports: import { CardComponent } from '../card/card.component';
everywhere in the library (probably in the cart-details component, but you truncated the error message)
That's right, I was able to fix the error, I focused on doing it like that and it was a folder architecture error haha
@zealous trout hmm now in my other project when i import library i have these error, probably i need do something on my library no?
Have you built it and installed it in that other project somehow?
yes yes of course with a npm i @ayudiego/ui-sdk after having published it of course, but i don't know what i have to change, i don't know if in the library or in my project.
there is the project @zealous trout https://github.com/AyuDiego/app-lib-project
You haven't deployed your library properly. Look at the files: https://www.npmjs.com/package/@ayudiego/ui-sdk?activeTab=code. This isthe source code, not the build library. Here's what it should look like: https://www.npmjs.com/package/ngx-valdemort?activeTab=code. What you need to publich is the built library. I.e. after doing ng build, you need to execute npm publish ./dist/my-lib/ui-sdk