Amplify-js: [Feedback]Application doesn't work for Angular production builds

Created on 14 Sep 2020  路  7Comments  路  Source: aws-amplify/amplify-js

Page: /start/q/integration/angular

Feedback:

When I follow these instructions the application will run with ng build. However, when running ng build --prod the resulting distribution will not run either locally or with the amplify console. The browser inevitably throws the error
ERROR TypeError: Cannot read property 'aws_appsync_region' of null (on chrome)
or
ERROR TypeError: "r is null" (on firefox)

I've tried this mostly with Angular 10.1.1. I also tried downgrading to angular 9 with the same result.

Angular

Most helpful comment

Hi @BenjaminNielsen, thanks for reporting the issue! I was able to reproduce it so I'll have this issue transferred to our js repo.

All 7 comments

Hi @BenjaminNielsen, thanks for reporting the issue! I was able to reproduce it so I'll have this issue transferred to our js repo.

+1 on this - my production build just failed when I deployed AWS Console build. Not having production working should make this issue priority 1? Any updates?

Thanks for the report! We're working on it!

https://github.com/aws-amplify/amplify-js/issues/6761

For a quick fix, you can manually register Auth via Amplify.register(Auth):

https://github.com/aws-amplify/amplify-js/issues/6761#issuecomment-697164608

For a quick fix, you can manually register Auth via Amplify.register(Auth):

#6761 (comment)

I was able to push a production build to amplify console after following your suggestion. Thank you!

Hi @BenjaminNielsen and @malcomm, sorry about the delay. We just pushed pr #6867 to latest that addresses this. Please try again with the latest amplify and let us know if this solves your issue. Thank you!

Hi @BenjaminNielsen and @malcomm, sorry about the delay. We just pushed pr #6867 to latest that addresses this. Please try again with the latest amplify and let us know if this solves your issue. Thank you!

I can confirm prod build are now working for me. Thanks so much!

Was this page helpful?
0 / 5 - 0 ratings