Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Angular 2 Universal "window is not defined" error. #167

Closed

Description

@epanchintsev

When using with Angular 2Universal retrieve error "Call to Node module failed with error: Prerendering failed because of error: ReferenceError: window is not defined".
Obviouse error caused by using window object in that fragment of style-loader

isOldIE = memoize(function() {
			return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
		})

Activity

  1. UnGast commented on Feb 9, 2017

    @UnGast

    I also experienced this with vue-server-renderer. It's in addStyles.js, line 14.

  2. leobudima commented on Feb 11, 2017

    @leobudima

    Same problem with React...

  3. UnGast commented on Feb 13, 2017

    @UnGast

    #159 seems to fix it.

  4. michael-ciniawsky commented on Mar 15, 2017

    @michael-ciniawsky
    Contributor

    @epanchintsev @UnGast @leobudima I'm sry you guys but style-loader won't support any SSR functionality and therefore this issue is sadly won't fix. See #159 for reasons and solutions/alternatives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions