New Vercel adapter generates conflicting lambda functions for routes with same filename but different directories #8401
Labels
- P5: urgent
Fix build-breaking bugs affecting most users, should be released ASAP (priority)
feat: ssr
Related to SSR (scope)
pkg: vercel
Related to Vercel adapter (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
New version of vercel adapter can generate invalid output if two routes have the same file name, but different directory structure.
Consider the structure of
pages
directory below. In some lines I added vercel function names generated by the adapter:For each page Vercel adapter is going to build a separate route handler. However, their names may conflict with each other, producing invalid output.
What's the expected result?
I would expect each route to produce separate lambda function.
I narrowed the problem down to this line in Vercel adapter:
https://github.com/withastro/astro/blob/main/packages/integrations/vercel/src/serverless/adapter.ts#L211
It generates function's directory name based on the file name only. I assume this will brake for every route with the same file names nested in different directories.
I can create PR soon.
Link to Minimal Reproducible Example
https://github.com/slawekkolodziej/secretsecret
Participation
The text was updated successfully, but these errors were encountered: