-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript barrels break build #195
Comments
Yes. There are some issue with barrels in the Angular compiler afaik. I don't know how and when exactly the issue occurs. However, I can say that it's better to use the full-path imports (pointing to a |
Yes that has been my way around this problem but I was really hoping to benefits of barrels |
Ok. Changed the title so that it's easier to track. I fear there's nothing we can do about it. I can try to find and post a link to the original issue but it will not be before the next week. |
Here are issues that are related:
Seeing all this, I think it's best to not use TypeScript barrels! |
I was facing a similar issue and fixed it by pointing directly at the index file like so.
|
I have created a minimal reproduction for this issue in a situation we were encountering it here: https://github.com/jeffora/ng-barrel. Hopefully the README is easy enough to follow, but I'm assuming this isn't actually a bug with ng-packagr, as the issue is the metadata.json is generated incorrectly with missing classes when using barrel files. cc @dherges |
I've also opened a pull request angular/angular#22856 which fixes the issue in my specific reproduction above, so might cover quite a few of these issues. |
Had same issue and changing all the bareels import statement in all the files helped solving this issue. |
angular/angular#22856 was just merged into patch (6.0) and master (6.1), thanks a lot for your effort @jeffora! For the record, should library authors re-bundle to create a fixed |
Hi, I'm building with Angular 6.1.8, and I still have this problem. So for me, appending @toupeira did you have to change any setting to make it work? |
@ianchi nevermind, I didn't test properly and |
* Simplified the inner folder structure * Remove inner modules in extensions lib * Expose nested modules by directly pointing instead of using barrels. See ng-packagr/ng-packagr/issues/195#issuecomment-342951630
* Simplified the inner folder structure * Remove inner modules in extensions lib * Expose nested modules by directly pointing instead of using barrels. See ng-packagr/ng-packagr/issues/195#issuecomment-342951630
I'm having the same issue. The error message is rather ambiguous, adding it here for search ability as it took me a while to find this thread...
|
- ng-packagr/ng-packagr#195 - required to import/export from an explicit file
- ng-packagr/ng-packagr#195 - required to import/export from an explicit file
Any update? |
A question about this issues, when using barrel's to export my components I can't access any of the items in project I want to use them in. I'm trying to use them in a directive service and am unable to import them into the service for use even though the build works and I can reference the components in HTML. Is this expected with the current bug of barrels? |
Closing as per #195 (comment) |
- ng-packagr/ng-packagr#195 - required to import/export from an explicit file
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. |
Type of Issue
Description
When trying to build a library of reusable Angular component, ng-packagr doesn't seem to package the generated distribution version correctly
How To Reproduce
ng-package.json
src/lib/public_api.ts
Then, in each
module
folder I have anindex.ts
to export the specific module:src/lib/modules/module-a/index.ts
Expected Behaviour
When I generate the library with
ng-packagr -p ng-package.json
, thengx-customer-library.metadata.json
contains only this line of code:However, everything is working fine if inside my
src/lib/public_api.ts
I add an extra/index
:Version Information
The text was updated successfully, but these errors were encountered: