Really weird thing happening. When I run npm start to test the /dev/billing endpoint I get the 500 error.
However when I run REACT_APP_STAGE=prod npm start to test the /prod/billing endpoint I get a Status 200: OK response…
Any ideas why this would happen when everything is the same on both environments???
Basically it has worked all along just not in dev…
UPDATE:
This has been resolved. It seems like there was an issue with deployment in SEED that is now synchronized correctly. I think it just took some time for the deployment to propagate across all environments.
I keep getting a message that the API is not configured when going to any section which tries to hit the API, I am able to authenticate but not see the list of messages or create a message from the web client.
Yeah, I’ve done that part, I was able to create a note on both, staging and prod, I’m also able to log in through the web app, but for some reason it fails when trying to fetch the notes…
return API.get(“notes”, “/notes”);
I checked the Amplify JS library version and it’s the same as in the repo (I cloned it from Github)
Solved the problem, I had a different package-lock.json because I had to fix some vulnerabilities, it updated the aws amplify package and that version broke the implementation, I went back and did npm install again and it’s now fixed but it brought back the vulnerabilities. Any ideas on this?
and I navigate to the settings page, I get an error on my localhost:3000 in Google Chrome on Mac OS:
Unhandled Rejection (Error): A cross-origin error was thrown. React doesn’t have access to the actual error object in development. See react-crossorigin-error for more information.
App.componentDidMount
src/App.js:30
this.setState({ isAuthenticating: false });
I don’t think the line above has anything to do with it.
My billing API tests fine with the mock event, I believe I have cors:true in all my methods in the serverless.yml file, I believe I have CORS options enabled in both the s3 Buckets hosting my front end and backend. I tried running “HTTPS=true npm start” and that didn’t help either.
When I remove the line from index.html:
Error: Please load Stripe.js (https://js.stripe.com/v3/) on this page to use react-stripe-elements. If Stripe.js isn’t available yet (it’s loading asynchronously, or you’re using server-side rendering), see react-stripe-elements#advanced-integrations
I hope it’s something simple and obvious that I missed.
I ran google chrome without CORS protection enabled:
And I was able to get a better error message. It told me I was using my secret stripe key instead of my publishable key. Oops.
I switched from the sk key to the pk key, and the billing form appeared on the settings page.
Thanks for your hard work on the site, I’m really enjoying learning through it.
Hey guys, when I submit my test card for a purchase I get thrown a Network Error. I’m able to submit a mock request through billing-event.json just fine. How do I check logs to verify what the error is? Also this is what the console looks like, it seems the link should be to /prod/billing but is instead directing to /prodbilling, where might I fix this path?
I’m not getting any Log Streams to show in /aws/lambda/notes-app-api-prod-billing.
As my screenshot shows it seems the path is missing a forward-slash, how do I ensure this is getting set properly? My billing path in serverless.yml is set correctly:
billing:
# Defines an HTTP API endpoint that calls the main function in billing.js
# - path: url path is /billing
# - method: POST request
handler: billing.main
events:
- http:
path: billing
method: post
cors: true
authorizer: aws_iam