-
Notifications
You must be signed in to change notification settings - Fork 12k
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
bug(commonjs): erroneous ngfactory #7910
Comments
@filipesilva Is there any update on this issue? I feel like 1.5.0 is nearing final and there has been no progress made here. To add on to symptoms of this issue, adding the
When running without the flag, the bundle size for the main module is also significantly smaller than it should be (which makes sense, since most of the lazy-loaded content isn't being compiled). cc @hansl for |
@CaerusKaru do you think this is related to #7901 perhaps? It also had to do with lazy modules and #8157 fixed it. @Brocco can you have a look? |
@filipesilva It's unrelated, the issue persists in RC.3 @Brocco Here's the updated rub, as far as my investigations have gone:
I'm hoping this is a simple module resolution issue, because it's incredibly frustrating. |
@MarkPieszak @Toxicable do you have any insight maybe? |
Some sub issues should be fixed with #8188 |
I haven't seen this one yet, but i'll take a look! |
|
#8188 also fixes the |
Can reproduce the server issue with Angular rc.6 and CLI 1.5 RC.3 and universal-starter repo. LAZY_MODULE_MAP generated inside the server bundle has reference to the Module instead of the NgModuleFactory - causing factory.create to be undefined. |
We have a separate fix for lazy modules in ng5. The problem is that making it work for ng5 seems to break ng4 so we'll do another RC with this fix whren it's ready (today hopefully) |
In case 7a36f6a was designed to be the fix, it does not fix the issue. |
@CaerusKaru what error are you getting? |
@Toxicable To be clear, this is when you import an Angular Material module into any NgModule (lazy-loaded or otherwise). You can use my sample repo as a starter. The error has not changed from the one initially posted. |
@CaerusKaru - hey - I think we started using this bug to track the factory.create error because we started seeing that in the universal starter. We will look into the original 'Module not Found' issue. |
Duplicate of angular/angular#20031 |
Please follow the discussion over the other issue, as this is an issue from Angular's own |
Thanks to everyone on this issue for tracking this down and getting a fix out so quickly. You all rock! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
cli
directorynpm install
andnpm run build:dynamic
To show the second type of error (detailed below):
MatCardModule
fromapp.module.ts
, and remove the reference to<mat-card>
inapp.component.ts
.npm run build:dynamic && npm run serve:dynamic
(which should succeed this time)localhost:4000
. Disable JavaScript and reload the pageTo show the third type of error (detailed below):
localhost:4000
and reload the pageThe log given by the failure.
Desired functionality.
AOT compilation needs to work for commonjs bundling where the bundle includes a lazy-loaded module that also includes an external module like Angular Material.
Mention any other details that might be useful.
This is an issue only when the external module is included in a lazy-loaded module. If it's included at the top-level, it works as expected. It also works as expected in [email protected]
The text was updated successfully, but these errors were encountered: