question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AngularCLI build with Ivy enabled fails on --prod flag build

See original GitHub issue

Describe the bug While trying to run ng build --prod on an AngularCLI project with Ivy enabled, it fails on the build

Same as #3620

To Reproduce Steps to reproduce the behavior:

  1. Create a new AngularCLI project
  2. Enable Ivy Compiler
  3. Install amplify packages npm install aws-amplify aws-amplify-angular
  4. Run ng build --prod

I’ve tried getting rid of both default compilerOptions and having ONLY IvyEnabled.

Expected behavior Build completes successfully

Screenshots

Build output

G:\Development\Personal\Wamplify>ng build --prod

chunk {0} runtime-es2015.703a23e48ad83c851e49.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main-es2015.efedd750490b14de3f18.js (main) 128 bytes [initial] [rendered]
chunk {2} polyfills-es2015.66a9e684cc8ebe117187.js (polyfills) 130 bytes [initial] [rendered]
chunk {3} styles.766cbe8e00b1dc50cc5e.css (styles) 62.6 kB [initial] [rendered]
Date: 2019-07-30T02:51:05.574Z - Hash: 6713af75921c4be3d6d8 - Time: 9551ms

ERROR in ENOENT: no such file or directory, open 'G:/Development/Personal/Wamplify/node_modules/aws-amplify-angular/bundles/aws-amplify-angular.umd.js'

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",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
    "types": [
      "node"
    ]
  },
  "angularCompilerOptions": {
    "enableIvy": true
  }
}

package.json

{
  "name": "wamplify",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.1.3",
    "@angular/cdk": "^8.1.2",
    "@angular/common": "~8.1.2",
    "@angular/compiler": "~8.1.2",
    "@angular/core": "~8.1.2",
    "@angular/forms": "~8.1.2",
    "@angular/material": "^8.1.2",
    "@angular/platform-browser": "~8.1.2",
    "@angular/platform-browser-dynamic": "~8.1.2",
    "@angular/router": "~8.1.2",
    "aws-amplify": "1.1.27",
    "aws-amplify-angular": "^3.0.3",
    "change-case": "^3.1.0",
    "hammerjs": "^2.0.8",
    "highlightjs": "^9.12.0",
    "marked": "^0.7.0",
    "moment": "^2.24.0",
    "ngx-markdown": "^8.1.0",
    "ngx-markdown-editor": "^2.0.0",
    "rxjs": "~6.4.0",
    "simplemde": "^1.11.2",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.801.2",
    "@angular/cli": "~8.1.2",
    "@angular/compiler-cli": "~8.1.2",
    "@angular/language-service": "~8.1.2",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^8.10.51",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  }
}

Desktop (please complete the following information): Windows 10. Building in Webstorm with Node v10.15.1

=

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
cjardinecommented, Jan 21, 2020

@haverchuck Is there any progress on this? Ivy delivers some compelling performance improvements (when I remove Amplify) but I’m now having to consider moving to other serverless solutions in anticipation of Angular 9 release (Ivy on by default; now in RC). Any information either way would be helpful and appreciated 😃

3reactions
wickstargazercommented, Mar 29, 2020

Hi guys, i have published @flowaccoun/aws-amplify-angular version 4.2.11

@flowaccount/aws-amplify-angular

Its working with angular 9 now, We need to use it now, so I took the liberty 😃

For the official version, the below steps need to be taken with the following Pull request

  1. Update yarn version to support ivy
  2. Review the code and confirm the tests
  3. Merge the Pull Request and we can move back to the official package!

For now, anyone has a hurry or urgent need like us, please use the ‘@flowaccount/awns-amplify-angular’ 😃

Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I enable Ivy for Angular 8 or 9? - Stack Overflow
To start a new project with Ivy enabled, use the --enable-ivy flag with the ng ... In the angular.json workspace configuration file, set...
Read more >
Error on build --prod - Ionic Angular
The problem happens when I use the command with the --prod flag ionic capacitor build android --prod I throw this error: ✓ Brow…...
Read more >
Angular workspace configuration
Angular CLI comes with two build configurations: production and development . By default, the ng build command uses the production configuration, which applies ......
Read more >
Deployment - Angular
Build your project using Github project name, with the Angular CLI command ng build and ... When you enable production builds via --prod...
Read more >
Understanding Angular Ivy Library Compilation | lacolaco/tech
When you develop an Angular library using Angular CLI or something similar, Ivy is currently disabled for production build.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found