-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Make Angular Material work in offline compiler #774
Comments
When trying to offline compile my Angular app, I get this error:
I'm trying to use the MdTooltipModule in my bootstrap module, but it doesn't compile 👎 |
(edit : corrected the issue number) #883 has been closed as a duplicate of this issue, but I don't think they are the same. I'm running an app with AoT offline compiler and Material modules (icon, button, card, input, menu, toolbar), and it's working very well. But it is not working with Universal. I get the same "window is not defined" error, as mentioned in #883. After a quick look at the code, Material umd bundles are full of reference to "window". Is that normal ? |
@cyrilletuzi I'm trying to work with Universal as well, no luck so far. You can bypass the window error by putting
I'm really not a webpack/node guy, but it's probably just a configuration issue, although I really can't find out what I should do. Any idea? |
@orangesoup Thanks for the @orangesoup Your import problem is just a config problem. Your tsconfig.json for ts-node must be set as :
(which is not the same config as for your webpack client build). |
See #308 We haven't had the opportunity yet to ensure that everything works with Universal, but it will be coming within the next few milestones. Happy to accept PRs to help improve this sooner, though. I'm actually going to close this issue now, since everything should be good for AoT AFAIK, and Angular Universal is tracked via #308. |
@cyrilletuzi You mean I have to manually build material with that tsconfig? |
@orangesoup no you don't need to build on server side, but as Angular 2 is in TypeScript, which is not understood by node natively, you need to use ts-node with that config. |
Any solution so far? |
@dotansimha @orangesoup See a temporary workaround here in #308 |
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. |
No description provided.
The text was updated successfully, but these errors were encountered: