Netlify function works locally, but doesnt work after deploy

I’m trying to deploy a netlify function on Locally when running netlify dev, everything works. But when I deploy my function with netlify deploy --dir=public, I get a http 500.

I figured I’d take a look at the function logs, but I don’t seem to get any kind of logging there; not for, or any of the preview or unique deploy urls.

Not really sure what I’m doing wrong, you can find my project on github here: GitHub - thepassle/blog

The command to deploy is netlify deploy --build

That seems to give me the same result; a 500 http error

Something is going wrong with the paths you’ve configured. I see this from our internal logs:

function route '/' is not a literal and it does not provide an expression

Sounds like something is going wrong with the routes you’ve configured. Try removing / from the path.

I need the '/' route, though. And '/' is a literal, so this sounds like a bug on your end?

I was merely asking you to try so we can confirm :slight_smile:

I tried changing it to /*, and now I do see something rendered. But this gives me another issue: error decoding lambda response: error decoding lambda response: unexpected end of JSON input, because I’m dynamically fetching some static assets. I’ve added preferStatic: true to my config export, and that seems to have done the trick, its rendering correctly now

Hey Pascal! I’ve looked into this, and there indeed seems to be a bug around the / route. Wrote a fix and am rolling it out over the coming days, will let you know once that’s done :slight_smile:

The fix was shipped, and / now works in my testing. Let me know if you’re seeing the same!