Astro/netlify functions

I am using astrojs/netlify adapter which helps build files. The output it produces in folder structure such that functions are deeply nested, so I tried to do this in netlify.toml

  node_bundler = "esbuild" 
    directory = ".netlify/v1/functions/ssr/.netlify/build"```
now when it comes to render those pages( dynamic) I get error

` error decoding lambda response: error decoding lambda response: unexpected end of JSON input`
I don't know whether it's an astro problem, or netlify problem, I just can't make them work. The rest of the routes, for static pages work fine.

this is astro.config

import { defineConfig } from ‘astro/config’;
import tailwind from ‘@astrojs/tailwind’;
import sitemap from ‘@astrojs/sitemap’;
import netlify from ‘@astrojs/netlify/functions’;

export default defineConfig({
output: ‘server’,
adapter: netlify(),
integrations: [
tailwind(),
sitemap(),
],
});


{
“name”: “usa-salvage-yards”,
“type”: “module”,
“version”: “0.0.1”,
“scripts”: {
“dev”: “astro dev”,
“start”: “astro dev”,
“build”: “astro build”,
“preview”: “astro preview”,
“astro”: “astro”
},
“dependencies”: {
@astrojs/netlify”: “^5.5.4”,
@astrojs/sitemap”: “^3.2.1”,
@astrojs/tailwind”: “^5.1.2”,
“astro”: “^4.16.12”,
“nodemailer”: “^6.9.16”,
“papaparse”: “^5.4.1”,
“tailwindcss”: “^3.4.15”
},
“devDependencies”: {
@types/nodemailer”: “^6.4.16”,
@types/papaparse”: “^5.3.15”
}
}

Your site appears to be working fine. Where’s the issue?

Sorry, should have been more precise, when you go to individual business page, so something like https://bespoke-gaufre-60e9df.netlify.app/states/ga/acworth/oreilly-auto-parts I get 404, when it should be handled by function. Other pages are prerendered and they work fine…

You seem to have a redirect to /.netlify/functions/entry. Have you tried removing it?

That is created in the build process, but yes, I have tried removing it to no avail…

Do you have a deploy (not made using CLI) where the redirect doesn’t exist?

The one running right now should be without it, it was manually deployed. Btw, thanks for looking into this :slightly_smiling_face:

I specifically asked for a non-manual deploy, plus the one running currently has the redirect.

I have just pushed it to git which triggered deploy…

The redirect rule still exists in the new deploy.

Because it is created during build process which I have no control over (via astrojs/netlify adapter) That’s why I have tried manual build and then removed it and then deploy…

Astro adapter used to create that redirect in its older versions. It doesn’t in the latest versions. The Function doesn’t even exist, so creating that redirect would make no sense. If it’s still doing it, it’s something worth reporting to Astro.

I am using the latest version, I have tried switching it to some older ones as well, I saw they produced some different folder structures but it still hasn’t worked. I have created issue on astro adapter github so we’ll see what they say. Thank you!

Have you got solution of this page or have you got it fixed. Because I’m seeing this is still returing 404 or something like that. I’m facing a similar problem on my page.

Unfortunately, no. Somebody did say on Astro Discord they were having similar problems and managed to solve it somehow but I couldn’t get them to elaborate on the solution. Maybe you will have better luck! If you do manage to solve it, please let me know!