Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an error occurred when requesting your unicorn undefined WildRydes #301

Open
swardet opened this issue Jan 25, 2021 · 2 comments
Open

an error occurred when requesting your unicorn undefined WildRydes #301

swardet opened this issue Jan 25, 2021 · 2 comments

Comments

@swardet
Copy link

swardet commented Jan 25, 2021

*an error occurred when requesting your unicorn: undefined

From https://aws.amazon.com/getting-started/hands-on/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/

Despite this issue being closed in April of 2018, something has changed since then, and it does not work. I've done this setup two times total and followed the instructions to the letter with a great attention to detail and it ends with the error "undefined" when you select the "Request Unicorn".

I can take the auth token from the /ride.html page to the API gateway > authorizers > paste as auth header > test and I get a 200 response code all day long. got this both times i finished the setup.

there's one thing in the setup that has changed. the setup says to use Node.js 6.10. but that is no longer available as an option. the first time i selected node.js 12.x and it didnt' work. the second time I selected node.js 10.x. still doesn't work.

I've seen all of what @mikedeck has had to say, and I can assure that I have spelled everything to the T. Mike has suggested that perhaps the function is named something different than RequestUnicorn. I can assure this isn't the case. For every single item in the module, I copied and pasted, and made sure there were no extra characters or spaces anywhere.

Mike makes mention of an invalid Authorization header at the URL at the end of this sentence(s), but I don't know how to make sure the same token I copied is actually getting passed in the Autorization HTTP header on the POST request made, because that's what the function(s) of the module(s) is supposed to do... take a logged in user's auth, then pass to the lambda functions with the cognito user pool and get a ride. here #97 (comment)

HELP?

*note: the word occurred is misspelled "An error occured..."
error-occur

@LiamYaoLian
Copy link

I have a similar issue. Pretty sure I have enabled CORS.

Below is the error from the console. Could somebody help with this? Thanks very much!

DevTools failed to load SourceMap: Could not load content for https://master.dpv7asj2g73va.amplifyapp.com/js/vendor/amazon-cognito-identity.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

DevTools failed to load SourceMap: Could not load content for https://master.dpv7asj2g73va.amplifyapp.com/js/vendor/aws-cognito-sdk.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

ride.html:1 Access to XMLHttpRequest at 'https://aok4y2nap7.execute-api.us-east-2.amazonaws.com/prod/ride' from origin 'https://master.dpv7asj2g73va.amplifyapp.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

ride.js:34 Error requesting ride: error , Details:
ajaxError @ ride.js:34
fire @ jquery-3.1.0.js:3243
fireWith @ jquery-3.1.0.js:3373
done @ jquery-3.1.0.js:9100
(anonymous) @ jquery-3.1.0.js:9332
error (async)
send @ jquery-3.1.0.js:9360
ajax @ jquery-3.1.0.js:8999
requestUnicorn @ ride.js:19
handleRequestClick @ ride.js:82
dispatch @ jquery-3.1.0.js:5110
elemData.handle @ jquery-3.1.0.js:4918
ride.js:35 Response: undefined
ajaxError @ ride.js:35
fire @ jquery-3.1.0.js:3243
fireWith @ jquery-3.1.0.js:3373
done @ jquery-3.1.0.js:9100
(anonymous) @ jquery-3.1.0.js:9332
error (async)
send @ jquery-3.1.0.js:9360
ajax @ jquery-3.1.0.js:8999
requestUnicorn @ ride.js:19
handleRequestClick @ ride.js:82
dispatch @ jquery-3.1.0.js:5110
elemData.handle @ jquery-3.1.0.js:4918

@mstachalski
Copy link

Running into the same problem here, too.

ride.js:34 Error requesting ride: error , Details:
ajaxError @ ride.js:34

ride.js:35 Response: undefined
ajaxError @ ride.js:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants