Skip to content
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

Update nextra-docs-template file structure & contents to match nextra@v3 #85

Open
nongrata081 opened this issue Oct 14, 2024 · 1 comment

Comments

@nongrata081
Copy link

nongrata081 commented Oct 14, 2024

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

@crguezl
Copy link

crguezl commented Oct 25, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants