Invalid route parameter returned by getStaticPaths().
GetStaticPathsInvalidRouteParam: Invalid
getStaticPaths()route parameter forKEY. Expected a string or undefined, receivedVALUE_TYPE(VALUE)
What went wrong?
Section titled “What went wrong?”Since params are encoded into the URL, only certain types are supported as values.
---export async function getStaticPaths() { return [ { params: { id: '1' } } // Works { params: { id: 2 } } // Does not work { params: { id: false } } // Does not work { params: { id: [1, 2] } } // Does not work ];}---In routes using rest parameters, undefined can be used to represent a path with no parameters passed in the URL:
---export async function getStaticPaths() { return [ { params: { id: '1' } } // /route/1 { params: { id: '2' } } // /route/2 { params: { id: undefined } } // /route/ ];}---See Also:
Error Reference