Nextra V4 Setup
Answered
Μοχάμεντ posted this in #help-forum
ΜοχάμεντOP
So i am trying to go from nextra v3 to v4 but it keeps giving error
- error [nextra] Error while loading { pathSegments: [] } Error: Cannot find module './undefined'
at webpackContextResolve (.next/server/app/docs/[[...mdxPath]]/page.js:58:11)
at webpackContext (.next/server/app/docs/[[...mdxPath]]/page.js:53:11)
at async Page (src/app/docs/[[...mdxPath]]/page.jsx:12:17)
10 | export default async function Page(props) {
11 | const params = await props.params
> 12 | const result = await importPage(params.mdxPath)
| ^
13 | const { default: MDXContent, toc, metadata } = result
14 | return (
15 | <Wrapper toc={toc} metadata={metadata}> {
code: 'MODULE_NOT_FOUND'
}
GET /docs 404 in 20974ms
11 Replies
ΜοχάμεντOP
or is there any other good docs generator?
that i can use with my already existing site
my app.jsx
/* eslint-disable react-hooks/rules-of-hooks -- false positive, useMDXComponents isn't react hooks */
import { generateStaticParamsFor, importPage } from 'nextra/pages'
import { useMDXComponents } from '../../../../mdx-components'
export const generateStaticParams = generateStaticParamsFor('mdxPath')
const Wrapper = useMDXComponents().wrapper
export default async function Page(props) {
const params = await props.params
const result = await importPage(params.mdxPath)
const { default: MDXContent, toc, metadata } = result
return (
<Wrapper toc={toc} metadata={metadata}>
<MDXContent {...props} params={params} />
</Wrapper>
)
}
ΜοχάμεντOP
ΜοχάμεντOP
had to delete my website
Answer