I'm trying to create an astro page using dynamic routing and pagination. I named the file as [galleryID]-[page].astro and this is the code https://pastebin.com/DWRFGbd0
Astro returns me a TypeError with "Expected "galleryID" to be a string", with this stacktrace
error Expected "galleryID" to be a string
File:
/home/sirio/Progetti/AASApp/node_modules/path-to-regexp/dist/index.js:237:19
Code:
236 | var typeOfMessage = repeat ? "an array" : "a string";
> 237 | throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage));
| ^
238 | }
239 | return path;
240 | };
Stacktrace:
TypeError: Expected "galleryID" to be a string
at Object.generate (/home/sirio/Progetti/AASApp/node_modules/path-to-regexp/dist/index.js:237:19)
at file:///home/sirio/Progetti/AASApp/node_modules/astro/dist/core/render/paginate.js:29:52
at Array.map (<anonymous>)
at paginateUtility (file:///home/sirio/Progetti/AASApp/node_modules/astro/dist/core/render/paginate.js:21:48)
at Module.getStaticPaths (/home/sirio/Progetti/AASApp/src/pages/gallery/[galleryID]-[page].astro:14:10)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async callGetStaticPaths (file:///home/sirio/Progetti/AASApp/node_modules/astro/dist/core/render/route-cache.js:25:17)
at async getParamsAndProps (file:///home/sirio/Progetti/AASApp/node_modules/astro/dist/core/render/params-and-props.js:11:23)
at async matchRoute (file:///home/sirio/Progetti/AASApp/node_modules/astro/dist/vite-plugin-astro-server/route.js:32:7)
at async run (file:///home/sirio/Progetti/AASApp/node_modules/astro/dist/vite-plugin-astro-server/request.js:51:28)
How can I retrieve galleryID to be used for photoset_id parameter in fetch url?
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.