-
Notifications
You must be signed in to change notification settings - Fork 12k
(webpack) Cannot import with barrels #1585
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
Comments
Could you give me the content of the index file for your shared directory? Thanks. |
I have the same issue. I can try to come up with a reduced example as well. I noticed it wont allow imports form barrels if they are components. Services and pipes seem to work just fine. This is what my export * from './components/collapse-text';
export * from './components/geo-button'
export * from './components/google-static-map';
export * from './components/image-gallery';
export * from './components/loading-spinner';
export * from './components/social-sharing-links';
export * from './dto/org';
export * from './dto/postal-code';
export * from './pipes/ellipsis.pipe';
export * from './services/geo.service';
export * from './services/graph.service';
export * from './services/postal-code.service';
export * from './services/postal-code.service';
export * from './services/sale.service';
export * from './services/settings.service';
export * from './services/viewport.service'; |
Okay. I suggest as a temporary workaround to remove the barrels. With Angular RC5 the styleguide is moving away from barrels and we will as well. Sorry for the temporary inconvenience. |
Sorry if I was missing some information. Barrels are being replaced with |
Thanks for the information @hansl |
@hansl so, just to be clear, this means that index.ts files are no longer the way to retrieve package contents? |
@hansl how would this work with e.g. domain objects? They are not components/directives. Right now we've got a separate file per domain class, and exporting them all in index.ts. |
You mean simple utility class? No one is preventing you from using a barrel, just that the CLI will not produce barrels anymore. If you have a specific issue, please file a separate issue with examples so we move the conversation there. I consider this done and will lock the conversation. |
Uh oh!
There was an error while loading. Please reload this page.
Please look at this code:
It will get an error:
EXCEPTION: Unexpected directive value 'undefined' on the View of component AppComponent'
When I dont use barrels:
It run properly.
So, what should I do ? Is this a bugs of angular cli ?
The text was updated successfully, but these errors were encountered: