Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vercel SSR error with dynamic routes #8407

Closed
1 task
nathanlawsn opened this issue Sep 4, 2023 · 2 comments
Closed
1 task

Vercel SSR error with dynamic routes #8407

nathanlawsn opened this issue Sep 4, 2023 · 2 comments
Labels
needs triage Issue needs to be triaged

Comments

@nathanlawsn
Copy link

Astro Info

Astro                    v3.0.8
Node                     v16.20.0
System                   Linux (x64)
Package Manager          unknown
Output                   hybrid
Adapter                  @astrojs/vercel/serverless
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Dynamic routes throw an error when deploying to Vercel.

https://astro-vercel-ssr-error.vercel.app/
https://astro-vercel-ssr-error.vercel.app/blog/blog-post-1

[ssr] Error: Expected an exported Astro component but received typeof undefined
    at renderPage (file:///var/task/vercel/path0/dist/chunks/entrypoint_eea6d45b.mjs:579:11)
    at #tryRenderRoute (file:///var/task/vercel/path0/dist/chunks/entrypoint_eea6d45b.mjs:774:24)
    at SSRRoutePipeline.renderRoute (file:///var/task/vercel/path0/dist/chunks/entrypoint_eea6d45b.mjs:721:46)
    at App.render (file:///var/task/vercel/path0/dist/chunks/entrypoint_eea6d45b.mjs:934:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.handler (file:///var/task/vercel/path0/dist/chunks/entrypoint_eea6d45b.mjs:1317:33)
    at async Server.<anonymous> (/var/task/___vc/__launcher.js:82:14)

It appears if you have multiple files with the same filename (e.g. [slug].astro) yet in separate directories then the dynamic route fails.

What's the expected result?

I should be able to have multiple dynamic routes under different directories. e.g. /blog

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-yrtccw

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 4, 2023
@ematipico
Copy link
Member

Is this a duplicate of #8401?

@lilnasy
Copy link
Contributor

lilnasy commented Sep 6, 2023

Confirmed fixed by #8408

@lilnasy lilnasy closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants