Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

ES2015 support #950

@S-Johny

Description

@S-Johny

Bug Report

What is the expected behavior?

To make FlexLayoutServerModule work under firebase cloud function.

What is the current behavior?

Getting an error after successful deploy to a firebase.

What are the steps to reproduce?

  1. Create Angular repo with SSR
  2. Add FlexLayout
  3. Use firebase to deploy cloud function

functions/package.json

  "name": "functions",
  "scripts": {
    "lint": "tslint --project tsconfig.json",
    "build": "tsc",
    "serve": "npm run build && firebase serve --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "main": "index.js",
  "dependencies": {
    "@angular/animations": "^7.1.0",
    "@angular/cdk": "^7.1.0",
    "@angular/common": "^7.1.0",
    "@angular/compiler": "^7.1.0",
    "@angular/core": "^7.1.0",
    "@angular/flex-layout": "^7.0.0-beta.22",
    "@angular/forms": "^7.1.0",
    "@angular/http": "^7.1.0",
    "@angular/platform-browser": "^7.1.0",
    "@angular/platform-browser-dynamic": "^7.1.0",
    "@angular/platform-server": "^7.1.0",
    "@angular/router": "^7.1.0",
    "@nguniversal/common": "^7.0.2",
    "@nguniversal/express-engine": "^7.0.2",
    "@nguniversal/module-map-ngfactory-loader": "^7.0.2",
    "@types/smoothscroll-polyfill": "^0.3.0",
    "firebase-admin": "^6.4.0",
    "firebase-functions": "^2.1.0",
    "compression": "^1.7.3",
    "core-js": "^2.5.4",
    "express": "^4.16.4",
    "hammerjs": "^2.0.8",
    "rxjs": "^6.3.3",
    "smoothscroll-polyfill": "^0.4.3",
    "ts-loader": "^5.3.0",
    "zone.js": "^0.8.26",
    "reflect-metadata": "^0.1.12"
  },
  "devDependencies": {
    "tslint": "^5.11.0",
    "typescript": "^3.1.6"
  },
  "private": true
}

app.server.module.ts

  imports: [
    AppModule,
    ServerModule,
    ModuleMapLoaderModule,
    ServerTransferStateModule,
    FlexLayoutServerModule,
  ],
  bootstrap: [AppComponent],
})
export class AppServerModule {}

error I am getting

TypeError: this.marshal.init is not a function
    at LayoutAlignDirective.BaseDirective2.init (/user_code/node_modules/@angular/flex-layout/bundles/flex-layout-core.umd.js:2416:22)
    at new LayoutAlignDirective (/user_code/node_modules/@angular/flex-layout/bundles/flex-layout-flex.umd.js:1529:15)
    at createClass (/user_code/node_modules/@angular/core/bundles/core.umd.js:20747:24)
    at createDirectiveInstance (/user_code/node_modules/@angular/core/bundles/core.umd.js:20616:24)
    at createViewNodes (/user_code/node_modules/@angular/core/bundles/core.umd.js:21842:40)
    at callViewAction (/user_code/node_modules/@angular/core/bundles/core.umd.js:22158:17)
    at execComponentViewsAction (/user_code/node_modules/@angular/core/bundles/core.umd.js:22077:17)
    at createViewNodes (/user_code/node_modules/@angular/core/bundles/core.umd.js:21870:9)
    at createRootView (/user_code/node_modules/@angular/core/bundles/core.umd.js:21756:9)
    at Object.createProdRootView [as createRootView] (/user_code/node_modules/@angular/core/bundles/core.umd.js:22268:16)
    at resolvePromise (/user_code/node_modules/zone.js/dist/zone-node.js:814:31)
    at resolvePromise (/user_code/node_modules/zone.js/dist/zone-node.js:771:17)
    at /user_code/node_modules/zone.js/dist/zone-node.js:873:17
    at ZoneDelegate.invokeTask (/user_code/node_modules/zone.js/dist/zone-node.js:421:31)
    at Object.onInvokeTask (/user_code/node_modules/@angular/core/bundles/core.umd.js:16192:37)
    at ZoneDelegate.invokeTask (/user_code/node_modules/zone.js/dist/zone-node.js:420:36)
    at Zone.runTask (/user_code/node_modules/zone.js/dist/zone-node.js:188:47)
    at drainMicroTaskQueue (/user_code/node_modules/zone.js/dist/zone-node.js:595:35)
    at ZoneTask.invokeTask (/user_code/node_modules/zone.js/dist/zone-node.js:500:21)
    at ZoneTask.invoke (/user_code/node_modules/zone.js/dist/zone-node.js:485:48)
  rejection: 
   TypeError: this.marshal.init is not a function
       at LayoutAlignDirective.BaseDirective2.init (/user_code/node_modules/@angular/flex-layout/bundles/flex-layout-core.umd.js:2416:22)
       at new LayoutAlignDirective (/user_code/node_modules/@angular/flex-layout/bundles/flex-layout-flex.umd.js:1529:15)
       at createClass (/user_code/node_modules/@angular/core/bundles/core.umd.js:20747:24)
       at createDirectiveInstance (/user_code/node_modules/@angular/core/bundles/core.umd.js:20616:24)
       at createViewNodes (/user_code/node_modules/@angular/core/bundles/core.umd.js:21842:40)
       at callViewAction (/user_code/node_modules/@angular/core/bundles/core.umd.js:22158:17)
       at execComponentViewsAction (/user_code/node_modules/@angular/core/bundles/core.umd.js:22077:17)
       at createViewNodes (/user_code/node_modules/@angular/core/bundles/core.umd.js:21870:9)
       at createRootView (/user_code/node_modules/@angular/core/bundles/core.umd.js:21756:9)
       at Object.createProdRootView [as createRootView] (/user_code/node_modules/@angular/core/bundles/core.umd.js:22268:16),
  promise: 
   ZoneAwarePromise {
     __zone_symbol__state: 0,
     __zone_symbol__value: 
      TypeError: this.marshal.init is not a function
          at LayoutAlignDirective.BaseDirective2.init (/user_code/node_modules/@angular/flex-layout/bundles/flex-layout-core.umd.js:2416:22)
          at new LayoutAlignDirective (/user_code/node_modules/@angular/flex-layout/bundles/flex-layout-flex.umd.js:1529:15)
          at createClass (/user_code/node_modules/@angular/core/bundles/core.umd.js:20747:24)
          at createDirectiveInstance (/user_code/node_modules/@angular/core/bundles/core.umd.js:20616:24)
          at createViewNodes (/user_code/node_modules/@angular/core/bundles/core.umd.js:21842:40)
          at callViewAction (/user_code/node_modules/@angular/core/bundles/core.umd.js:22158:17)
          at execComponentViewsAction (/user_code/node_modules/@angular/core/bundles/core.umd.js:22077:17)
          at createViewNodes (/user_code/node_modules/@angular/core/bundles/core.umd.js:21870:9)
          at createRootView (/user_code/node_modules/@angular/core/bundles/core.umd.js:21756:9)
          at Object.createProdRootView [as createRootView] (/user_code/node_modules/@angular/core/bundles/core.umd.js:22268:16) },
  zone: 
   Zone {
     _properties: { isAngularZone: true },
     _parent: 
      Zone {
        _properties: {},
        _parent: null,
        _name: '<root>',
        _zoneDelegate: [Object] },
     _name: 'angular',
     _zoneDelegate: 
      ZoneDelegate {
        _taskCounts: [Object],
        zone: [Circular],
        _parentDelegate: [Object],
        _forkZS: null,
        _forkDlgt: null,
        _forkCurrZone: [Object],
        _interceptZS: null,
        _interceptDlgt: null,
        _interceptCurrZone: [Object],
        _invokeZS: [Object],
        _invokeDlgt: [Object],
        _invokeCurrZone: [Circular],
        _handl

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions