Ng-lazyload-image: Não funciona com a construção de prod com NG9

Criado em 15 jun. 2020  ·  2Comentários  ·  Fonte: tjoskar/ng-lazyload-image

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.1.8
Node: 12.10.0
OS: linux x64

Angular: 9.1.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: No

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.8
@angular-devkit/build-angular     0.901.8
@angular-devkit/build-optimizer   0.901.8
@angular-devkit/build-webpack     0.901.8
@angular-devkit/core              9.1.8
@angular-devkit/schematics        9.1.8
@angular/cdk                      9.2.4
@angular/cli                      9.1.8
@angular/http                     7.2.16
@angular/material                 9.2.4
@ngtools/webpack                  9.1.8
@schematics/angular               9.1.8
@schematics/update                0.901.8
rxjs                              6.5.5
typescript                        3.9.5
webpack                           4.42.0

versão da imagem ng-lazyload: ^ 8.0.1

ERROR no erro durante a compilação do template de 'AppModule'
Expressões de função não são suportadas em decoradores em 'LazyLoadImageModule'
'LazyLoadImageModule' contém o erro em ../../../ng-lazyload-image/ng-lazyload-image.ts(22,23)
Considere alterar a expressão da função em uma função exportada.

Todos 2 comentários

Oi,
Você pode tentar adicionar:

"angularCompilerOptions": {
    "enableIvy": false
  }

Em seu tsconfig.json e tsconfig.app.json para que se pareçam com:
tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "enableIvy": false
  }
}

tsconfig.app.json:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.d.ts"
  ],
  "angularCompilerOptions": {
    "enableIvy": false
  }
}

Parece uma duplicata de # 463

Esta página foi útil?
0 / 5 - 0 avaliações