create-react-app-lambda icon indicating copy to clipboard operation
create-react-app-lambda copied to clipboard

error: lambda functions are not working in localhost

Open maiya-22 opened this issue 3 years ago • 1 comments

Steps to repeat error:

  • download repo to desktop
  • npm install
  • in one terminal: npm run start
  • on another terminal npm run start:lambda

in the browser, at localhost 3000, press the buttons to call the lambda functions:

  • error in console: VM271:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

  • in browser url http://localhost:9000/.netlify/functions/hello responds with hello world.

  • in browser url http://localhost:9000/.netlify/functions/async-dadjoke responds with {"msg":"Request failed with status code 503"} (think that's expected).

maiya-22 avatar Feb 13 '22 13:02 maiya-22

use this

https://github.com/Kirbyasdf/netlify-react-lambda-node-boilerplate

Kirbyasdf avatar Oct 03 '22 18:10 Kirbyasdf