Hey all, we’re having some issues with the netlify functions we use to generate sitemaps. They run fine when we run the build locally using netlify dev
, but never get invoked in deployment.
Checking the function logs yields nothing – there are none. The only logs that exist are the created
ones for each function.
Deploy logs are all green – no issues.
The edge functions also run fine.
Logging any errors locally didn’t yield any results because locally, everything works as it should.
Below are the build details:
Site name: [https://delos-clone-test.netlify.app](https://delos-clone-test.netlify.app/)
Functions dir: netlify/functions (matches the repo)
Build command: npm run generate
Publish directory: dist
Functions Region: US East (Ohio) - us-east-2
Node.js: 18.x
As far as functions: our current billion period lists 0 invocations (uh-oh).
The function itself uses a util that compiles a sitemap from Storyblok. Running locally, the util function works fine. Again, nothing in the logs since the function apparently never gets invoked, so if it errors in prod, it isn’t being logged.
import DelosSitemapUtils from '~/utils/DelosSitemapUtils.js'
export default async (req, context) => {
const routes = await DelosSitemapUtils.generateSitemap('en')
const sitemapString = await DelosSitemapUtils.serveSitemap(
routes,
'https://delos.com'
)
return new Response(sitemapString, {
headers: { 'content-type': 'application/xml' },
})
}
export const config = {
path: '/sitemap.xml',
method: 'GET',
}