aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

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

Closed willkara closed 2 years ago

willkara commented 5 years ago

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

=

haverchuck commented 5 years ago

@willkara - In the angularCompiler options, can you try setting the 'fullTemplateTypeCheck' to false? We realize this is not a true solution, but interested to know if it unblocks you for now.

willkara commented 5 years ago

@haverchuck at work now, but will check when I get home.

haverchuck commented 5 years ago

@willkara I don't think we are able to support Ivy yet. We will be making a note of this in our documentation.

willkara commented 5 years ago

No problem 😁 thank for checking back in.

On Fri, Aug 2, 2019, 10:52 Dustin Noyes notifications@github.com wrote:

@willkara https://github.com/willkara I don't think we are able to support Ivy yet. We will be making a note of this in our documentation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-amplify/amplify-js/issues/3762?email_source=notifications&email_token=AAZAQJ3CRGY7WCSLPVZ4F3DQCRCZ7A5CNFSM4IHX3JW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3N7AZQ#issuecomment-517730406, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZAQJ7DI3L6MB3CWKAPY23QCRCZ7ANCNFSM4IHX3JWQ .

cjardine commented 4 years ago

@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 :)

wickstargazer commented 4 years ago

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

tannerabread commented 2 years ago

Closing as the package aws-amplify-angular is now deprecated and the UI team has fixed this issue with the new angular authenticator component. Please see this comment detailing next steps if you are still facing this issue