-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
undefined
params within getStaticPaths cause Vercel build to fail
#6095
Comments
Ok there seems to be an inconsistency with the behaviour between API routes and Pages where for Pages |
Cheers! That’s the tactic I’ve opted for now; with a It’s fine in the meantime, but of course would be nice to have matching behaviour across all routes |
Following up: It seems like this workaround unfortunately doesn't work The λ src/pages/example/index.ts
--
17:26:26.181 | └─ /assets/example (+16ms)
17:26:26.181 | λ src/pages/example/[slug].ts
17:26:26.495 | error ENOTDIR: not a directory, mkdir '/vercel/path0/.vercel/output/static/example/' |
Sorry I might not have been clear on what I meant exactly, you do not need to create a separate My suggestion was to replace this line:
with the following
|
Thanks @AirBorne04! That seems to work for endpoints, but not for regular pages joe-bell/astro-bug-params-undefined#1
|
i wan to check out, but I feel like i'm missing out on something. |
What version of
astro
are you using?2.0.0
Are you using an SSR adapter? If so, which one?
Vercel
What package manager are you using?
pnpm
What operating system are you using?
Mac
Describe the Bug
Expectation
When using
params
in agetStaticPaths
function, I would expectundefined
to result in the creation of an index route.Actual Behaviour
The build fails in Vercel
Success: Without
undefined
params
19:36:18.324 ▶ src/pages/example/[...slug].astro 19:36:18.345 ├─ /example/one/index.html (+21ms) 19:36:18.347 ├─ /example/two/index.html (+23ms) 19:36:18.348 └─ /example/three/index.html (+25ms) 19:36:18.349 λ src/pages/api/example/[...slug].ts 19:36:18.350 ├─ /api/example/one (+1ms) 19:36:18.351 ├─ /api/example/two (+2ms) 19:36:18.351 └─ /api/example/three (+3ms) 19:36:18.351 Completed in 59ms.
Error: With
undefined
params
Link to Minimal Reproducible Example
https://github.com/joe-bell/astro-bug-params-undefined
Participation
Not part of the template, but just want to say a huge thanks to the Astro team – I love using this product and I appreciate you all!
The text was updated successfully, but these errors were encountered: