Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Angular Template: EXCEPTION: Uncaught (in promise): ReferenceError: window is not defined #323

Closed
@hheexx

Description

@hheexx

After updating all files to newest template I receive this stack trace in server console:

fail: Microsoft.AspNetCore.NodeServices[0]
EXCEPTION: Uncaught (in promise): ReferenceError: window is not defined
fail: Microsoft.AspNetCore.NodeServices[0]
ORIGINAL STACKTRACE:
fail: Microsoft.AspNetCore.NodeServices[0]
Error: Uncaught (in promise): ReferenceError: window is not defined
at resolvePromise (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:418:31)
at C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:454:17
at ZoneDelegate.invokeTask (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:225:37)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (C:\Users\hexbo\Documents\cx_public\node_modules@angular\core\bundles\core.umd.js:6233:41)
at ZoneDelegate.invokeTask (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:224:42)
at Zone.runTask (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:125:47)
at drainMicroTaskQueue (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:357:35)
at runMicrotasksCallback (internal/process/next_tick.js:58:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
fail: Microsoft.AspNetCore.NodeServices[0]
Unhandled Promise rejection: window is not defined ; Zone: angular ; Task: Promise.then ; Value: ReferenceError: window is not defined
at SafeSubscriber._next (C:\Users\hexbo\Documents\cx_public\ClientApp\boot-server.js:6:27799)
at SafeSubscriber.__tryOrUnsub (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:223:16)
at SafeSubscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:172:22)
at Subscriber._next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:125:26)
at Subscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:89:18)
at Subject.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subject.js:55:25)
at resolveData$.forEach.then._this.navigated (C:\Users\hexbo\Documents\cx_public\node_modules@angular\router\bundles\router.umd.js:2650:44)
at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:192:28)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (C:\Users\hexbo\Documents\cx_public\node_modules@angular\core\bundles\core.umd.js:6242:41)
at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:191:34) ReferenceError: window is not defined
at SafeSubscriber._next (C:\Users\hexbo\Documents\cx_public\ClientApp\boot-server.js:6:27799)
at SafeSubscriber.__tryOrUnsub (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:223:16)
at SafeSubscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:172:22)
at Subscriber._next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:125:26)
at Subscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:89:18)
at Subject.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subject.js:55:25)
at resolveData$.forEach.then._this.navigated (C:\Users\hexbo\Documents\cx_public\node_modules@angular\router\bundles\router.umd.js:2650:44)
at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:192:28)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (C:\Users\hexbo\Documents\cx_public\node_modules@angular\core\bundles\core.umd.js:6242:41)
at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:191:34)
fail: Microsoft.AspNetCore.NodeServices[0]
{ Error: Uncaught (in promise): ReferenceError: window is not defined
at resolvePromise (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:418:31)
at C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:454:17
at ZoneDelegate.invokeTask (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:225:37)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (C:\Users\hexbo\Documents\cx_public\node_modules@angular\core\bundles\core.umd.js:6233:41)
at ZoneDelegate.invokeTask (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:224:42)
at Zone.runTask (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:125:47)
at drainMicroTaskQueue (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:357:35)
at runMicrotasksCallback (internal/process/next_tick.js:58:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
fail: Microsoft.AspNetCore.NodeServices[0]

    rejection:
     ReferenceError: window is not defined
         at SafeSubscriber._next (C:\Users\hexbo\Documents\cx_public\ClientApp\boot-server.js:6:27799)
         at SafeSubscriber.__tryOrUnsub (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:223:16)
         at SafeSubscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:172:22)
         at Subscriber._next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:125:26)
         at Subscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:89:18)
         at Subject.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subject.js:55:25)
         at resolveData$.forEach.then._this.navigated (C:\Users\hexbo\Documents\cx_public\node_modules\@angular\router\bundles\router.umd.js:2650:44)
         at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:192:28)
         at Object.NgZoneImpl.inner.inner.fork.onInvoke (C:\Users\hexbo\Documents\cx_public\node_modules\@angular\core\bundles\core.umd.js:6242:41)
         at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:191:34),

fail: Microsoft.AspNetCore.NodeServices[0]

    promise:
     ZoneAwarePromise {

fail: Microsoft.AspNetCore.NodeServices[0]

       __zone_symbol__state: 0,

fail: Microsoft.AspNetCore.NodeServices[0]

       __zone_symbol__value:
        ReferenceError: window is not defined
            at SafeSubscriber._next (C:\Users\hexbo\Documents\cx_public\ClientApp\boot-server.js:6:27799)
            at SafeSubscriber.__tryOrUnsub (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:223:16)
            at SafeSubscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:172:22)
            at Subscriber._next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:125:26)
            at Subscriber.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subscriber.js:89:18)
            at Subject.next (C:\Users\hexbo\Documents\cx_public\node_modules\rxjs\Subject.js:55:25)
            at resolveData$.forEach.then._this.navigated (C:\Users\hexbo\Documents\cx_public\node_modules\@angular\router\bundles\router.umd.js:2650:44)
            at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:192:28)
            at Object.NgZoneImpl.inner.inner.fork.onInvoke (C:\Users\hexbo\Documents\cx_public\node_modules\@angular\core\bundles\core.umd.js:6242:41)
            at ZoneDelegate.invoke (C:\Users\hexbo\Documents\cx_public\node_modules\zone.js\dist\zone-node.js:191:34) },

fail: Microsoft.AspNetCore.NodeServices[0]

    zone:
     Zone {

fail: Microsoft.AspNetCore.NodeServices[0]

       _properties: { isAngularZone: true },

fail: Microsoft.AspNetCore.NodeServices[0]

       _parent:
        Zone {

fail: Microsoft.AspNetCore.NodeServices[0]

          _properties: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _parent: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _name: 'angular-universal request',

fail: Microsoft.AspNetCore.NodeServices[0]

          _zoneDelegate: [Object] },

fail: Microsoft.AspNetCore.NodeServices[0]

       _name: 'angular',

fail: Microsoft.AspNetCore.NodeServices[0]

       _zoneDelegate:
        ZoneDelegate {

fail: Microsoft.AspNetCore.NodeServices[0]

          _taskCounts: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          zone: [Circular],

fail: Microsoft.AspNetCore.NodeServices[0]

          _parentDelegate: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _forkZS: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _forkDlgt: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _interceptZS: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _interceptDlgt: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _invokeZS: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _invokeDlgt: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _handleErrorZS: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _handleErrorDlgt: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _scheduleTaskZS: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _scheduleTaskDlgt: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _invokeTaskZS: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _invokeTaskDlgt: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _cancelTaskZS: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _cancelTaskDlgt: null,

fail: Microsoft.AspNetCore.NodeServices[0]

          _hasTaskZS: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _hasTaskDlgt: [Object] } },

fail: Microsoft.AspNetCore.NodeServices[0]

    task:
     ZoneTask {

fail: Microsoft.AspNetCore.NodeServices[0]

       runCount: 1,

fail: Microsoft.AspNetCore.NodeServices[0]

       type: 'microTask',

fail: Microsoft.AspNetCore.NodeServices[0]

       zone:
        Zone {

fail: Microsoft.AspNetCore.NodeServices[0]

          _properties: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _parent: [Object],

fail: Microsoft.AspNetCore.NodeServices[0]

          _name: 'angular',

fail: Microsoft.AspNetCore.NodeServices[0]

          _zoneDelegate: [Object] },

fail: Microsoft.AspNetCore.NodeServices[0]

       source: 'Promise.then',

fail: Microsoft.AspNetCore.NodeServices[0]

       data: undefined,

fail: Microsoft.AspNetCore.NodeServices[0]

       scheduleFn: undefined,

fail: Microsoft.AspNetCore.NodeServices[0]

       cancelFn: null,

fail: Microsoft.AspNetCore.NodeServices[0]

       callback: [Function],

fail: Microsoft.AspNetCore.NodeServices[0]

       invoke: [Function] } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions