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

Not working prod build with NG9 #465

Closed
dozsan opened this issue Jun 15, 2020 · 2 comments
Closed

Not working prod build with NG9 #465

dozsan opened this issue Jun 15, 2020 · 2 comments

Comments

@dozsan
Copy link

dozsan commented Jun 15, 2020

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

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

ng-lazyload-image version: ^8.0.1

ERROR in Error during template compile of 'AppModule'
Function expressions are not supported in decorators in 'LazyLoadImageModule'
'LazyLoadImageModule' contains the error at ../../../ng-lazyload-image/ng-lazyload-image.ts(22,23)
Consider changing the function expression into an exported function.

@tjoskar
Copy link
Owner

tjoskar commented Jun 16, 2020

Hi,
Can you try to add:

"angularCompilerOptions": {
    "enableIvy": false
  }

In your tsconfig.json and tsconfig.app.json so they look something like:
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
  }
}

@tjoskar
Copy link
Owner

tjoskar commented Jun 16, 2020

This looks like a duplicate of #463

@tjoskar tjoskar closed this as completed Jun 16, 2020
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

2 participants