Update nextra-docs-template file structure & contents to match nextra@v3
Issue:
Currently nextra-docs-template's files correspond to nextra@v2 (e.g. pages/_meta.json, next.config.js > require('nextra'), etc.), even though in package.json nextra version is latestwhich currently points to [email protected].
Solution:
Update the files and their contents to match nextra@v3 according to v3 migration guide
@shuding
Agree with @nongrata081. Here are the implied versions:
➜ nextra-docs-template git:(main) ✗ git remote -v
origin https://github.com/shuding/nextra-docs-template.git (fetch)
origin https://github.com/shuding/nextra-docs-template.git (push)
➜ nextra-docs-template git:(main) ✗ git lg | head -n 2
7178f36 - (HEAD -> main, origin/main, origin/HEAD) Merge pull request #66 from EndangeredMassa/endangeredmassa/update-lockfile-version (hace 7 meses Shu Ding)
4a93f53 - update lockfile version (hace 7 meses Sean Massa)
➜ nextra-docs-template node --version
v20.5.0
➜ nextra-docs-template git:(main) ✗ npx next --version
Next.js v13.5.7
➜ nextra-docs-template git:(main) ✗ npm ls nextra
[email protected] /Users/casianorodriguezleon/campus-virtual/2223/learning/nextjs-learning/nextra-learning/nextra-docs-template
├─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]
When you run dev with npm you get an error:
➜ nextra-docs-template npm run dev
> [email protected] dev
> next dev
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/casianorodriguezleon/campus-virtual/2223/learning/nextjs-learning/nextra-learning/nextra-docs-template/node_modules/nextra/package.json
at new NodeError (node:internal/errors:405:5)
at exportsNotFound (node:internal/modules/esm/resolve:261:10)
at packageExportsResolve (node:internal/modules/esm/resolve:535:13)
at resolveExports (node:internal/modules/cjs/loader:547:36)
at Module._findPath (node:internal/modules/cjs/loader:621:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
at /Users/casianorodriguezleon/campus-virtual/2223/learning/nextjs-learning/nextra-learning/nextra-docs-template/node_modules/next/dist/server/require-hook.js:54:36
at Module._load (node:internal/modules/cjs/loader:901:27)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at mod.require (/Users/casianorodriguezleon/campus-virtual/2223/learning/nextjs-learning/nextra-learning/nextra-docs-template/node_modules/next/dist/server/require-hook.js:64:28) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v20.5.0
The error does not appear if you use pnpm since the file pnpm-lock.yaml sets the depedency from nextra@v2. If it is not removed, it is inconsistent with the latest dependency in package.json
Hi, I just created template for this , https://github.com/ShrihariMohan/nextra-v3-docs-template
Hi, I just created template for this , https://github.com/ShrihariMohan/nextra-v3-docs-template
Thanks but after checking out your code the darkMode button doesn't seem to work.
After adding darkMode: true, to the theme.config.tsx the dark mode button appears but doesn't work
Hi, I just created template for this , https://github.com/ShrihariMohan/nextra-v3-docs-template
Thanks but after checking out your code the darkMode button doesn't seem to work. After adding
darkMode: true,to thetheme.config.tsxthe dark mode button appears but doesn't work
Oh , Thanks I will update the template , thats because of the param forcedTheme set to light should work if we remove that .