Skip to content
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

AOT + barrels not supported #13193

Closed
rolandoldengarm opened this issue Dec 2, 2016 · 7 comments
Closed

AOT + barrels not supported #13193

rolandoldengarm opened this issue Dec 2, 2016 · 7 comments
Labels
area: core Issues related to the framework runtime

Comments

@rolandoldengarm
Copy link

rolandoldengarm commented Dec 2, 2016

I'm submitting a ... (check one with "x")

[* ] bug report => search github for a similar issue or PR before submitting
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
In an index.ts I export a class in that folder.
When I import this file in another class, I get an error that the module could not be found:

ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve 'app/core' in 'C:\Projects\temp\ng-cli-aot\src\app'
 @ ./src/app/app.module.ts 1:0-34
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/main.ts
 @ multi main

Expected behavior
In JIT this works fine, I expect the same with AOT.

Minimal reproduction of the problem with instructions
https://github.com/rolandoldengarm/ng-cli-aot

run "ng build --aot"

Even though I'm using Angular CLI, this is an Angular bug I believe.

  • Node (for AoT issues): node --version =
    6.9.1
@chuckjaz chuckjaz added the area: core Issues related to the framework runtime label Dec 8, 2016
@DzmitryShylovich
Copy link
Contributor

@rolandoldengarm can't reproduce in angular 4. can you confirm and close the issue lease? thanks

@rolandoldengarm
Copy link
Author

I'm not able to test in Angular 4.
Plus I'm no longer using barrels.

Well not a lot of activity here anyway, let's close it.

@DzmitryShylovich
Copy link
Contributor

Plus I'm no longer using barrels.

👍

@battmanz
Copy link

battmanz commented Jun 13, 2017

@DzmitryShylovich I noticed you gave the thumbs up to not using barrels. Is it discouraged to use barrels?

@tytskyi
Copy link

tytskyi commented Jun 13, 2017

@battmanz i think it was suggested to use them some time ago, but current guide says in the last sentence:

You can often achieve the same result using Angular modules instead.

https://angular.io/guide/glossary#barrel

* i am not an angular team member etc, this is only my opinion and understanding

@tytskyi
Copy link

tytskyi commented Jun 13, 2017

update:

https://angular.io/guide/change-log

"Style Guide" with NgModules (2016-09-27)
StyleGuide explains recommended conventions for Angular modules (NgModule). Barrels now are far less useful and have been removed from the style guide; they remain valuable but are not a matter of Angular style.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime
Projects
None yet
Development

No branches or pull requests

5 participants