-
Notifications
You must be signed in to change notification settings - Fork 12k
Prod build fails with "Can't resolve '@angular/material/material' #7062
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
Hi, I'm not sure of what i'll say but you can give it a try. |
Thanks for your response, BobBDE. The Typescript change is interesting and sounds relevant. I couldn't find any references to "@angular/material/material" in the app. Maybe this path referenced by one of the dependencies, or the theming support. I'll try stripping down my sample app further to see what I can get working. But I'm confused because I've already removed all the components, services etc. |
Same issue here. It didn't seem to be caused by the latest angular though. It might be something to do with node/npm versions. |
alex321: what versions of node/npm do you have? I'm using node 7.1.0, npm 3.10.9. |
Same here with: |
Same here:
|
@SteveHWork |
I have investigated it further and on #5802 I have tried it out, and indeed the error was not there anymore, and dist of 15MB became 3MB. |
@criticalbh yeah this should work with those parameters because you disabled the aot compilation. You can do it until the problem is fix but you should not keep this solution because thanks to the AOT compilation the performances are really improved (mostly in launch time). |
@BobBDE Thanks for pointing it out. |
@criticalbh with |
Heya, I don't really know what the problem is but there's an issue to track it in the Angular Material2 repo: angular/components#6046 I'll reopen here if needed. |
Heya, the Material team has identified the issue in angular/components#6046, and are looking to fix it. |
I have this error when i'm using angular/material and can't solve it : |
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.
@angular/cli: 1.2.1
node: 7.1.0
os: win32 x64
@angular/animations: 4.3.1
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/upgrade: 4.3.1
@angular/cli: 1.2.1
@angular/compiler-cli: 4.3.1
Repro steps.
Attached a cut down project that shows the issue:
TestApp.zip
npm install
ng build --prod
The log given by the failure.
ERROR in ./app/$$_gendir/app.module.ngfactory.ts
Module not found: Error: Can't resolve '@angular/material/material'
in 'C:\Code\app$$_gendir'
@ ./app/$$_gendir/app.module.ngfactory.ts 30:0-50
@ ./app/main.ts
@ multi ./app/main.ts
Desired functionality.
Prod build completes without error.
Mention any other details that might be useful.
This works with angular v4.2.6 but fails with v4.3.0/v4.3.1
A non-prod build works fine.
The text was updated successfully, but these errors were encountered: