You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make Angular Material work in offline compiler #774
@cyrilletuzi I'm trying to work with Universal as well, no luck so far. You can bypass the window error by putting var window = undefined in those umd bundles, but after that I ran into an issue:
@orangesoup Thanks for the var window = undefined; trick, it worked. Of course it is not a good solution, but I don't know how to fix that correctly, any idea @jelbourn@hansl ?
@orangesoup Your import problem is just a config problem. Your tsconfig.json for ts-node must be set as :
"target": "es2015",
"module": "commonjs"
(which is not the same config as for your webpack client build).
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.
@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?
I am using Universal and unable to import the material modules.
Always the same error - "window is no defined". using alpha8-1.
Older versions worked just fine :(
Activity
luisfurnas commentedon Aug 30, 2016
When trying to offline compile my Angular app, I get this error:
Error encountered resolving symbol values statically. Reference to a local (non-exported) symbol 'coreModules'.I'm trying to use the MdTooltipModule in my bootstrap module, but it doesn't compile 👎
cyrilletuzi commentedon Sep 13, 2016
(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 ?
orangesoup commentedon Sep 14, 2016
@cyrilletuzi I'm trying to work with Universal as well, no luck so far. You can bypass the window error by putting
var window = undefinedin those umd bundles, but after that I ran into an issue: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?
cyrilletuzi commentedon Sep 14, 2016
@orangesoup Thanks for the
var window = undefined;trick, it worked. Of course it is not a good solution, but I don't know how to fix that correctly, any idea @jelbourn @hansl ?@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).
jelbourn commentedon Sep 14, 2016
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.
orangesoup commentedon Sep 14, 2016
@cyrilletuzi You mean I have to manually build material with that tsconfig?
cyrilletuzi commentedon Sep 14, 2016
@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.
dotansimha commentedon Sep 15, 2016
Any solution so far?
I am using Universal and unable to import the material modules.
Always the same error - "window is no defined". using alpha8-1.
Older versions worked just fine :(
cyrilletuzi commentedon Sep 17, 2016
@dotansimha @orangesoup See a temporary workaround here in #308
angular-automatic-lock-bot commentedon Sep 5, 2019
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.