Skip to content

Commit

Permalink
fix Unhandled Runtime Error: No content found for <route> (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Aug 9, 2022
1 parent 2217f9c commit 6dc4dee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-radios-work.md
@@ -0,0 +1,5 @@
---
'nextra': patch
---

fix `Unhandled Runtime Error: No content found for <route>`
5 changes: 2 additions & 3 deletions packages/nextra/src/loader.ts
Expand Up @@ -169,7 +169,7 @@ export default MDXContent`.trimStart()
? `import __nextra_themeConfig__ from '${slash(path.resolve(themeConfig))}'`
: ''
const pageOpts: Omit<PageOpts, 'title'> = {
filename: slash(filename),
filename,
route: slash(route),
meta,
pageMap,
Expand All @@ -182,8 +182,7 @@ export default MDXContent`.trimStart()

const pageNextRoute =
'/' +
path
.relative(pagesDir, resourcePath)
slash(path.relative(pagesDir, resourcePath))
// Remove the `mdx?` extension
.replace(MARKDOWN_EXTENSION_REGEX, '')
// Remove the `*/index` suffix
Expand Down

0 comments on commit 6dc4dee

Please sign in to comment.