How to fix graphql 404 on Netlify

My Netlify app shows Error: Unexpected token < in JSON at position 0 in the browser and its console shows a 404 for the post of /.redwood/functions/graphql

https://app.netlify.com/sites/hardcore-heyrovsky-fd2e0f/functions/graphql shows:

Endpoint: https://hardcore-heyrovsky-fd2e0f.netlify.app/.netlify/functions/graphql

But my redwood.toml (which I’ve never touched) says apiProxyPath = "/.redwood/functions" even though https://redwoodjs.com/docs/app-configuration-redwood-toml says apiProxyPath = "/.netlify/functions" is the default.

Is this why I’m getting a 404 for my graphql endpoint?

Everything works locally on yarn rw dev.

Thanks.

That worked!

I don’t know why my redwood.toml was out of whack.

That seemed to be the last hurdle; it took me ~10 hours to get that Netlify deployment working.

Possible to deploy without a database? looked like it would be helpful but actually caused some other issues. I will write a separate post about what challenges I faced and what the workarounds were.

Ah, huge bummer this was a 10 hour pain :grimacing:. Sorry about that.

Now that Redwood is supporting multiple hosting providers, there’s an additional step to first setup for a host. Here’s the new doc: https://redwoodjs.com/docs/deploy

Guessing you didn’t know about the ‘yarn rw g deploy …’ command?

And would welcome Issues and doc fixes!!

1 Like

Ahh, nope, I didn’t know about that. That makes sense. Thanks for sending!

1 Like

@thedavid By the way, I can’t tell you how much I appreciate your responses and knowing that whenever I’m working with RedwoodJs you or your team will be available. I’ve been raving about you to everyone (and I will also send you a private message).

2 Likes

Means the world, truly.

And any credit gets shared across many amazing people doing awesome work. Thanks for trusting us and sharing your excitement :rocket:

1 Like

Here is the post I promised: Deploy failed due to an error in @netlify/plugin-functions-core plugin

1 Like