aws-mobile-ionic-sample
aws-mobile-ionic-sample copied to clipboard
building the app throws errors
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
Same issue.
I have the same problem, anyone have found a work around?
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.
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.
(Apologize for any typos) Sent from mobile.
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.
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 }, {})
}
}
}