Netlify adapter in Sveltekit

Hi,

I recently started working with Svelte and created a small app with SvelteKit where I added the netlify adapter for netlify functions. I also added the netlify.toml file with the specified configuration.

I noticed that the functions created in the functions directory are not deployed instead the render function is created and deployed, that contains all the logic from the endpoints.

  1. Why netlify doesn’t recognize/deploy the custom netlify functions I created in the functions directory?
  2. If I don’t use the netlify adapter where/how the endpoints run on the prod env?

Thank you!

It’s the adapter causing problems, not Netlify. Check this out: https://github.com/sveltejs/kit/blob/master/packages/adapter-netlify/index.js#L16. That line is deleting everything from the functions folder, so your functions are getting deleted too.

I’m not sure what you mean by this, possible because I’m not familiar with Svelte myself. But, I would suggest to open an issue on the package so they can help you out.

1 Like