aws-mobile-ionic-sample icon indicating copy to clipboard operation
aws-mobile-ionic-sample copied to clipboard

building the app throws errors

Open superandrew opened this issue 7 years ago • 6 comments

I suppose it may depend on my configuration, however I've been through many errors, the last (runtime) one being:

Reference error: aws_cloud_logic_custom is not defined

I deployed manually the zip file because of https://github.com/awslabs/aws-mobile-ionic-sample/issues/8

superandrew avatar Jan 21 '18 16:01 superandrew

Same issue.

HandleConsolidated avatar Jan 29 '18 17:01 HandleConsolidated

I have the same problem, anyone have found a work around?

AleCat83 avatar Feb 02 '18 15:02 AleCat83

I think that I've resolved it in my case: since I'm not using Cloud Logic I haven't enabled it inside AWS MOBILE HUB, thus the aws-config.js file doesn't include the variable"aws_cloud_logic_custom" expected by app.config.ts. So if you are using Cloud Logic I think that the solution should be to enable it inside AWS Mobile HUB and regenerate the aws-config.js file. In case you don't use this service the solution should be to remove the references inside the app.config.ts file.

AleCat83 avatar Feb 02 '18 15:02 AleCat83

Hey Alex!

I was able to work past it. I’m sorry for not posting my solution. I found that my same issue was the variable: “aws_cloud_logic_custom” in the app.config.ts file.

I can also confirm that after removing that variable, my cloud logic and lambda functions with my DynamoDB tables remain operational and without error. I wonder if this variable may be for something else that t AWS team may have forgotten to remove or something else.

HandleConsolidated avatar Feb 02 '18 23:02 HandleConsolidated

(Apologize for any typos) Sent from mobile.

HandleConsolidated avatar Feb 02 '18 23:02 HandleConsolidated

Hi, I was very interested in getting this running but I run into few issues not sure how to address, first I was getting aws_cloud_logic_custom error as described above, I tried commenting it out but then I started getting the aws_cognito_rgion error so seems to be declaration problem for some reason. Any ideas how to by pass that would be appreciated

ReferenceError: aws_cloud_logic_custom is not defined at AwsConfig.load (http://localhost:8100/build/main.js:200028:53) at Object. (http://localhost:8100/build/main.js:154750:221) at webpack_require (http://localhost:8100/build/main.js:20:30) at Object. (http://localhost:8100/build/main.js:127323:70) at webpack_require (http://localhost:8100/build/main.js:20:30) at http://localhost:8100/build/main.js:63:18 at http://localhost:8100/build/main.js:66:10

import { Injectable } from '@angular/core'

declare const aws_cognito_region declare const aws_user_pools_id declare const aws_user_pools_web_client_id declare const aws_cognito_identity_pool_id declare const aws_cloud_logic_custom

@Injectable() export class AwsConfig { public load () { let aws_cloud_logic_custom_obj = JSON.parse(aws_cloud_logic_custom) return { 'region': aws_cognito_region, // region you are deploying (all lower caps, e.g: us-east-1) 'userPoolId': aws_user_pools_id, // your user pool ID 'appId': aws_user_pools_web_client_id, // your user pool app ID 'idpURL': cognito-idp.${aws_cognito_region}.amazonaws.com, // cognito idp url 'identityPool': aws_cognito_identity_pool_id, // your federated identity pool ID 'APIs': aws_cloud_logic_custom_obj.reduce((m, v) => { m[v.name] = v.endpoint; return m }, {}) } } }

keedar avatar Jan 03 '19 05:01 keedar