-
Notifications
You must be signed in to change notification settings - Fork 217
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
Error: A required parameter (username) was not provided as a string in getStaticPaths for /[username]/[slug] #27
Comments
I haded the same problem but when I console .log I found undefind in username and slug |
Could you explain in a more detailed way, please? |
yes sure when I console.log(paths) I found undefined values attributed to slug and username which caused the problem somehow so I deleted the firebase database then rerun the code and allowed to create the database again so the solutions are two either delete your database from firebase or try this code : this was one of the error that gave me the idea while trying to fix it:
|
Could you please send the full [username]/[slug].js code? |
|
`import styles from '@styles/Post.module.css'; import Link from 'next/link'; export async function getStaticProps({ params }) { let post; if (userDoc) {
} return { export default function Post(props) { const post = realtimePost || props.post; const { user: currentUser } = useContext(UserContext); return (
); |
I just had the same issue, what solved it for me... Make sure in your subcollection (posts), the document name needs to match the slug value. Solved it for me! Again you have.... 'DOCNAMEHERE' needs to be the same as the 'slug' field. 👍 |
Error: A required parameter (username) was not provided as a string in getStaticPaths for /[username]/[slug]
How do I fix this issue?
The text was updated successfully, but these errors were encountered: