#getStaticPaths() expected event to be a string
63 messages · Page 1 of 1 (latest)
Can you try
params: { id: id }
it is still the same problem
Is id a string?
yes when i hover over it it says (parameter) id: string
Might want to add some console logs to make sure it's getting the right value
Unelss that looks right
yes that should be the right link
alrighty try params: { event: id }
now it gives me 404
Property 'id' does not exist on type '{ event: string; }'.
now it highlights row 30
did that now there are no problems anymore but still if i go on the link it leads to 404
Any errors in the terminal with the 404?
(server console, not client)
can also restart the dev server so astro sync runs again
22:03:23 [astro:db] New local database created.
22:03:23 [astro:db] Seeded database.
22:03:28 [WARN] [router] A getStaticPaths() route pattern was matched, but no matching static path was found for requested path /events/Kornmahlen%20in%20Maria%20Luggau.
Possible dynamic routes being matched: src/pages/events/[event].astro.
22:03:28 [404] /events/Kornmahlen%20in%20Maria%20Luggau 3ms
22:03:33 [200] / 1205ms
22:03:35 [WARN] [router] A getStaticPaths() route pattern was matched, but no matching static path was found for requested path /events/Kornmahlen%20in%20Maria%20Luggau.
Possible dynamic routes being matched: src/pages/events/[event].astro.
22:03:35 [404] /events/Kornmahlen%20in%20Maria%20Luggau 0ms
i did the sync
maybe the file needs to be called [...event].astro I'm not to sure there, I always get foggy on the catch alls
in the docs it is with [name].astro
The example under that looks pretty similar to what you need here
Worth a shot to try renaming the file I think
Possible dynamic routes being matched: src/pages/events/[event].astro.
22:03:28 [404] /events/Kornmahlen%20in%20Maria%20Luggau 3ms
22:03:33 [200] / 1205ms
22:03:35 [WARN] [router] A getStaticPaths() route pattern was matched, but no matching static path was found for requested path /events/Kornmahlen%20in%20Maria%20Luggau.
Possible dynamic routes being matched: src/pages/events/[event].astro.
22:03:35 [404] /events/Kornmahlen%20in%20Maria%20Luggau 0ms
22:09:13 [watch] src/pages/events/[event].astro
22:09:19 [WARN] [router] A getStaticPaths() route pattern was matched, but no matching static path was found for requested path /events/Kornmahlen%20in%20Maria%20Luggau.
Possible dynamic routes being matched: src/pages/events/[...event].astro.
22:09:19 [404] /events/Kornmahlen%20in%20Maria%20Luggau 1ms
now i get this but still 404
<@&1129102257422610512>
I'm having a brain fart here, what is the obvious thing I'm missing?
I think this actually just got fixed in the latest version. Can you try installing 4.15.6 ?
is there a console command to update this ?
ok thank you i will try it
FYI - you should probably use a slugify function on your id, so that /events/Kornmahlen%20in%20Maria%20Luggau, looks like this: /events/kornmahlen-in-maria-luggau instead.
Did that work?
Tbh i have some trouble with updating npm error code ENOENT
npm error syscall lstat
npm error path C:\Users\andre\AppData\Roaming\npm
npm error errno -4058
npm error enoent ENOENT: no such file or directory, lstat 'C:\Users\andre\AppData\Roaming\npm'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
Are you using npm?
and thanks for the tipp i did that
i ran npm install and restartet i also changed the version in package.json and package-lock.json
<@&1129102257422610512> does anyone know what i did wrong?
I'd just npm i astro@latest etc for everything
and i get an 404 if i click on the link
That whole filter statement inside there seems interesting
I don't think you want that
Remember that this is static generation, so at build time these pages will be prepared, it doesn't act like a live filter
You should just iterate your raw events
im a little bit confused could you give me an example
You take your events and find the unique tags of said events
You then filter out the first event for each tag
an example input array and output array would really help align understandings cough cough unit tests
So you're only generating pages for those events, so you wouldn't be able to reach any other event
Ok i tried first thing i think i dont need to filter anything then i just want to make a site for every event i have in my db there also shouldnt be any duplicates
i tried it now with a example i saw in the docs
https://github.com/Princesseuh/erika.florist/blob/9da559f78062e01dc6db6a5a06e9aa637933eab4/src/pages/articles/tags/[tag]/[...page].astro any use for you? seems similar
My website. Contribute to Princesseuh/erika.florist development by creating an account on GitHub.