List API No 'Access-Control-Allow-Origin'


#1

I review the previous post on this and was not able to debug the issue.

I get the following error in chrome dev tools console when calling the list api ‘No ‘Access-Control-Allow-Origin’ header is present on the requested resource.’

I have checked the following sources for failure:

  • libs/response-lib.js sets the headers Access-Control-Allow-Origin to “*” and Access-Control-Allow-Credentials to true
  • serverless.yml authorizer attribute is correctly indented
  • I successfully ran the test POSTing to /notes at the end of the deployment section
  • I used the IAM Policy Simulator to simulate invoking API Gateway with the IAM role provided to authenticated users by the identity pool

I am not sure how else to troubleshoot this. Any advice is appreciated.

Thanks,
David


#2

Yeah this error can sometimes be super cryptic. It is likely that there is an error in the Lambda. Can you use this chapter to turn on CloudWatch logs and check if you see anything there?