Skip to content
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

Angular Universal #102

Open
CrackerakiUA opened this issue Apr 26, 2021 · 1 comment
Open

Angular Universal #102

CrackerakiUA opened this issue Apr 26, 2021 · 1 comment

Comments

@CrackerakiUA
Copy link

Describe the bug
javascript global variable is not available on node.js and used within core plugin.

Reproduction
just start new angular universal project and put flatpickr on the page

Expected behavior
no errors

ReferenceError: navigator is not defined
    at CoreService.ios (C:\dist\bookety\server\main.js:209548:20)
    at new CoreService (C:\dist\bookety\server\main.js:209508:23)
    at Object.CoreService_Factory [as factory] (C:\dist\bookety\server\main.js:209846:61)
    at R3Injector.hydrate (C:\dist\bookety\server\main.js:123895:35)
    at R3Injector.get (C:\dist\bookety\server\main.js:123717:33)
    at NgModuleRef$1.get (C:\dist\bookety\server\main.js:136849:33)
    at R3Injector.get (C:\dist\bookety\server\main.js:123728:33)
    at injectInjectorOnly (C:\dist\bookety\server\main.js:113505:33)
    at Module.ɵɵinject (C:\dist\bookety\server\main.js:113509:57)
    at Object.MetaService_Factory [as factory] (C:\dist\bookety\server\main.js:210004:370)
    at resolvePromise (C:\dist\bookety\server\main.js:105276:39)
    at resolvePromise (C:\dist\bookety\server\main.js:105228:21)
    at C:\dist\bookety\server\main.js:105338:21
    at ZoneDelegate.crGB.ZoneDelegate.invokeTask (C:\dist\bookety\server\main.js:104865:35)
    at Object.onInvokeTask (C:\dist\bookety\server\main.js:140080:33)
    at ZoneDelegate.crGB.ZoneDelegate.invokeTask (C:\dist\bookety\server\main.js:104864:40)
    at Zone.crGB.Zone.runTask (C:\dist\bookety\server\main.js:104632:51)
    at drainMicroTaskQueue (C:\dist\bookety\server\main.js:105045:39)
    at crGB.ZoneTask.invokeTask (C:\dist\bookety\server\main.js:104951:25)
    at Server.ZoneTask.invoke (C:\dist\bookety\server\main.js:104936:52) {
  rejection: ReferenceError: navigator is not defined
      at CoreService.ios (C:\dist\bookety\server\main.js:209548:20)
      at new CoreService (C:\dist\bookety\server\main.js:209508:23)
      at Object.CoreService_Factory [as factory] (C:\dist\bookety\server\main.js:209846:61)
      at R3Injector.hydrate (C:\dist\bookety\server\main.js:123895:35)
      at R3Injector.get (C:\dist\bookety\server\main.js:123717:33)
      at NgModuleRef$1.get (C:\dist\bookety\server\main.js:136849:33)
      at R3Injector.get (C:\dist\bookety\server\main.js:123728:33)
      at injectInjectorOnly (C:\dist\bookety\server\main.js:113505:33)
      at Module.ɵɵinject (C:\dist\bookety\server\main.js:113509:57)
      at Object.MetaService_Factory [as factory] (C:\dist\bookety\server\main.js:210004:370),
  promise: ZoneAwarePromise [Promise] {
    __zone_symbol__state: 0,
    __zone_symbol__value: ReferenceError: navigator is not defined
        at CoreService.ios (C:\dist\bookety\server\main.js:209548:20)
        at new CoreService (C:\dist\bookety\server\main.js:209508:23)
        at Object.CoreService_Factory [as factory] (C:\dist\bookety\server\main.js:209846:61)
        at R3Injector.hydrate (C:\dist\bookety\server\main.js:123895:35)
        at R3Injector.get (C:\dist\bookety\server\main.js:123717:33)
        at NgModuleRef$1.get (C:\dist\bookety\server\main.js:136849:33)
        at R3Injector.get (C:\dist\bookety\server\main.js:123728:33)
        at injectInjectorOnly (C:\dist\bookety\server\main.js:113505:33)
        at Module.ɵɵinject (C:\dist\bookety\server\main.js:113509:57)
        at Object.MetaService_Factory [as factory] (C:\dist\bookety\server\main.js:210004:370)
  },
  zone: Zone {
    _parent: Zone {
      _parent: null,
      _name: '<root>',
      _properties: {},
      _zoneDelegate: [ZoneDelegate]
    },
    _name: 'angular',
    _properties: { isAngularZone: true, maybeDelayChangeDetection: false },
    _zoneDelegate: ZoneDelegate {
      _taskCounts: [Object],
      zone: [Circular],
      _parentDelegate: [ZoneDelegate],
      _forkZS: null,
      _forkDlgt: null,
      _forkCurrZone: null,
      _interceptZS: null,
      _interceptDlgt: null,
      _interceptCurrZone: null,
      _invokeZS: [Object],
      _invokeDlgt: [ZoneDelegate],
      _invokeCurrZone: [Circular],
      _handleErrorZS: [Object],
      _handleErrorDlgt: [ZoneDelegate],
      _handleErrorCurrZone: [Circular],
      _scheduleTaskZS: [Object],
      _scheduleTaskDlgt: [ZoneDelegate],
      _scheduleTaskCurrZone: [Circular],
      _invokeTaskZS: [Object],
      _invokeTaskDlgt: [ZoneDelegate],
      _invokeTaskCurrZone: [Circular],
      _cancelTaskZS: [Object],
      _cancelTaskDlgt: [ZoneDelegate],
      _cancelTaskCurrZone: [Circular],
      _hasTaskZS: [Object],
      _hasTaskDlgt: [ZoneDelegate],
      _hasTaskDlgtOwner: [Circular],
      _hasTaskCurrZone: [Circular]
    }
  },
  task: ZoneTask {
    _zone: Zone {
      _parent: [Zone],
      _name: 'angular',
      _properties: [Object],
      _zoneDelegate: [ZoneDelegate]
    },
    runCount: 0,
    _zoneDelegates: null,
    _state: 'notScheduled',
    type: 'microTask',
    source: 'Promise.then',
    data: ZoneAwarePromise [Promise] {
      __zone_symbol__state: 0,
      __zone_symbol__value: ReferenceError: navigator is not defined
          at CoreService.ios (C:\dist\bookety\server\main.js:209548:20)
          at new CoreService (C:\dist\bookety\server\main.js:209508:23)
          at Object.CoreService_Factory [as factory] (C:\dist\bookety\server\main.js:209846:61)
          at R3Injector.hydrate (C:\dist\bookety\server\main.js:123895:35)
          at R3Injector.get (C:\dist\bookety\server\main.js:123717:33)
          at NgModuleRef$1.get (C:\dist\bookety\server\main.js:136849:33)
          at R3Injector.get (C:\dist\bookety\server\main.js:123728:33)
          at injectInjectorOnly (C:\dist\bookety\server\main.js:113505:33)
          at Module.ɵɵinject (C:\dist\bookety\server\main.js:113509:57)
          at Object.MetaService_Factory [as factory] (C:\dist\bookety\server\main.js:210004:370)
    },
    scheduleFn: undefined,
    cancelFn: undefined,
    callback: [Function],
    invoke: [Function]
  }
}
@CrackerakiUA
Copy link
Author

Workaround is definitely to not show flatpickr on Angular Universal, feel free to close the issue, just wanted you to know about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant