errors/no-typos.mdx
Prevent common typos in Next.js data fetching functions.
A near-miss spelling of a Next.js data fetching function was detected. This rule checks for typos in these exports inside the pages/ directory:
getStaticPropsgetStaticPathsgetServerSidePropsWhen the name is off by even a single character, Next.js will not recognize the export and your data fetching logic will silently not run.
Check the spelling and casing of your exported function so it matches a Next.js data fetching function exactly.
Before:
// Typo: "getStaticProp" instead of "getStaticProps"
export async function getStaticProp() {
return {
props: {},
}
}
After:
export async function getStaticProps() {
return {
props: {},
}
}
Casing also matters — a single wrong-case letter will trip the rule:
// Typo: lowercase "p" in "props"
export async function getServerSideprops() {
return { props: {} }
}