Identity function with dependencies on gatsby site, no log


I’ve been playing with identity functions - identity-signup to be specific, but I cannot get the log to print anything out I log it just hangs. I created a basic hello world function and I can see the log on that.

exports.handler = async event => {
  const { user } = JSON.parse(event.body);
  console.log(JSON.stringify(user, null, 2));
  return {
    statusCode: 200,
    body: JSON.stringify({ app_metadata: { roles: ["sub:free"] } })

This is running on a gatsby site. The build command uses pushd and popd to install a dependency that I will be using once I’ve got this working

  command = "pushd functions && npm i && popd && npm run build"
  publish = "public"
  functions = "functions"

Hey! Not my forte however it looks like you’re tinkering with Jason’s recent work. Do you need all of this functionality or are you looking at a simple sign-in? Cos our docs cover that :slight_smile:

Very True,

For some reason he started out with a gatsby site, then ditched it part way through the twitch stream and went for vanilla js. I was wondering if there was any specific config issues with running serverless functions with dependencies, the build file and gatsby?

Hi, just wanted to point out that event-triggered functions like identity-signup will not have functioning logs and is a known issue. View related post here: Functions logs not loading. As a workaround, you will need to rename that function to something non-event-triggered and then set up a identity webhook notification pointed at your function.

Let me know if that works for you.

hey there! there’s no issue between Gatsby and serverless functions — I switch to plain HTML/JS because there were some things with setting up wrapRootElement and other Gatsby-specific plumbing that I didn’t have enough time to set up on stream

the cleaned up, finalized function is now in this repo in case you want to see the complete code

good luck!