First and foremost, thank you so much for the Beta release - Material2 is shaping up to be really really great.
After updating to beta.1, I'm getting following console.warnings in the browser:
/~/@angular/material/module.js 89:16 export 'ProjectionModule' was not found in './core/index'
./~/@angular/material/dialog/index.js 21:75 export 'Platform' was not found in '../core'
./~/@angular/material/dialog/index.js 21:75 export 'Platform' was not found in '../core'
I tried to do a clean install of everything, to no avail.
My environment:
Angular: 4.0.0-beta.1
Webpack: 2.1.0-beta.22
Cheers, guys - and merry Xmas everybody
Are you trying to import the dialog module on it's own?
@crisbeto nope
Weird, are you trying to import any other Material modules on their own, instead of using the MaterialModule? I'm asking since I've had it in my backlog to go through and make sure that everything can be imported individually.
@crisbeto No I'm pretty sure I don't import anything individually.
If it helps, in my production build I get the following error (after compilation), which sounds like it has something to do with the snackbar component (which I'm not using btw):
Uncaught TypeError: Cannot read property 'prototype' of undefined
at a (vendor.e43598c….bundle.js:34)
at vendor.e43598c….bundle.js:34
at Object../node_modules/@angular/material/snack-bar/snack-bar-container.js (vendor.e43598c….bundle.js:34)
at o (polyfills.7dc20f5….bundle.js:1)
at Object../node_modules/@angular/material/snack-bar/snack-bar.js (vendor.e
Reverting back to alpha.11 solves the issue, so something is off....
This looks like it's caused by the same issue as #2401
@DevVersion - and the workaround with the webpack alias hack doesn't solve AoT compilation. I've also tried to play with setting up aliasing in my typescript config during compilation, but that does not seem to work.
Reverting back to alpha-11 seems to be only viable option right now.
@spock123 Can you try the following:
import { MaterialModule } from '@angular/material/bundles/material.umd.js';This is very similar to the
Webpackalias but it might be worth trying it out.
@DevVersion didn't seem to fix the issue, sorry.
It's really no rush, let's just wait for Webpack to fix the issue with missing exports
@spock123 Thanks for your thoughtfulness.
Nevertheless, since I'm also interested if it's caused by the Webpack 2 issue, do you have a public repository for your project which can be shared & used for reproduction?
If not, then just sending the Webpack configuration would be fine as well.
@DevVersion unfortunately not right now.. I'm so sorry.. ... it's actually an app we use internally (yes, it's in production hehe.. ) at my job so I cannot put it out there...
I'll play around a bit more to see if I can make it compile nicely.. focus focus focus :)
@spock123 No worries 😄 Thanks for the patience.
I am having the same issue with these versions. Happy to try to reproduce for you on a smaller repository. Let me know how I can get that to you.
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/material": "^2.0.0-beta.1",
@spock123 Webpack 2.2.0-rc3 has been released. Can you try your issue with that new version?
@DevVersion I'm on it, thanks for the heads up! Stay tuned :)
Update: oh well Webpack 2.2.x broke a lot of stuff in my build, trying to resolve... probably the webpack-dev-server...
Update2: Webpack breaks so much that I can't get it to work with my loaders, plugins etc.. it's really a mess how the 2.2 configuration changes all the time (I understand the reasons - good reasons), just not easy to get a configuration that doesn't throw tons of errors..
@DevVersion WORKS!
Thanks for the tip - I really had to work a lot to change my webpack configuration (which is unrelated to this issue, I know)..
Anyway: Webpack 2.2 solves the issue. I'm a happy camper
Happy New Year to you
PS: I'm actually happy that Webpack configuration now has to observe a specific Api.. it's less magic/wild-west and more controlled.
@spock123 Awesome! Yeah happy new year to you as well!
I cloned the leashed-in demo and updated everything in the package.json to the following:
"dependencies": {
"@angular/common": "^2.3.0",
"@angular/compiler": "^2.3.0",
"@angular/core": "^2.3.0",
"@angular/forms": "^2.3.0",
"@angular/http": "^2.3.0",
"@angular/material": "^2.0.0-beta.1",
"@angular/platform-browser": "^2.3.0",
"@angular/platform-browser-dynamic": "^2.3.0",
"@angular/router": "3.0.0",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"rxjs": "5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@types/jasmine": "^2.5.38",
"angular-cli": "1.0.0-beta.15",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.0.10"
}
And I experienced this same problem. It appears that the leashed-in project uses webpack, but I can't see where to update that in the project. Do I just add it in?
Actually, I have this problem with just the base clone of the leashed-in project. (Running in IntelliJ and starting the project with npm start)
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._
Most helpful comment
@spock123 Awesome! Yeah happy new year to you as well!