-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfulseverity3: broken
Milestone
Description
Bug Report or Feature Request (mark with an x
)
- [x] bug report
- [ ] feature request
Versions.
@angular/cli: 1.5.0-beta.2
node: 8.6.0
os: darwin x64
@angular/animations: 5.0.0-rc.0
@angular/cdk: 2.0.0-beta.11
@angular/common: 5.0.0-rc.0
@angular/compiler: 5.0.0-rc.0
@angular/core: 5.0.0-rc.0
@angular/forms: 5.0.0-rc.0
@angular/http: 5.0.0-rc.0
@angular/material: 2.0.0-beta.11
@angular/platform-browser: 5.0.0-rc.0
@angular/platform-browser-dynamic: 5.0.0-rc.0
@angular/platform-server: 5.0.0-rc.0
@angular/router: 5.0.0-rc.0
@angular/cli: 1.5.0-beta.2
@angular/compiler-cli: 5.0.0-rc.0
@angular/language-service: 5.0.0-rc.0
typescript: 2.5.3
Repro steps.
- Clone the sample repo found here
- Change into the
cli
directory - Run
npm install
andnpm run build:dynamic
To show the second type of error (detailed below):
- After the steps above, remove
MatCardModule
fromapp.module.ts
, and remove the reference to<mat-card>
inapp.component.ts
. - Run
npm run build:dynamic && npm run serve:dynamic
(which should succeed this time) - Navigate to
localhost:4000
. Disable JavaScript and reload the page - Attempt to navigate to the lazy route, examine the server for the error log
To show the third type of error (detailed below):
- Re-enable JavaScript on
localhost:4000
and reload the page - Attempt to navigate to the lazy route, examine the browser console for the error log
The log given by the failure.
ERROR in ./dist/server/main.bundle.js
Module not found: Error: Can't resolve '@angular/material/card/typings/index.ngfactory' in '/Users/main/universal-cli-bug/cli/dist/server'
@ ./dist/server/main.bundle.js 1:2433-2490
@ ./prerender.ts
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 cli@1.4.4
sylvaindumont
Metadata
Metadata
Assignees
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfulseverity3: broken