Open rexx-p opened 1 year ago
@rexx-p I have solved the issue.
Change yournext.config.js
file to next.config.mjs
and add the example code below.
import nextra from "nextra";
const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
staticImage: true,
latex: true,
flexsearch: {
codeblock: false,
},
});
export default withNextra();
This issue helped fix it for me. Just pinning the next js version to 13.3.0
. Thanks to @Min5407
Thank you @Min5407
It's worth noting that if you still have problems running the template, you should rename this file:
"Error: Support of "_meta.json"
was removed, use "_meta.{js,jsx,ts,tsx}""
With the following refactor:
import { DocsThemeConfig } from "nextra-theme-docs";
export default {
index: "Introduction",
another: "Another Page",
advanced: "Advanced (A Folder)",
about: {
title: "About",
type: "page",
},
contact: {
title: "Contact ↗",
type: "page",
href: "https://twitter.com/shuding_",
newWindow: true,
},
} as DocsThemeConfig;
$ node -v v16.14.2
$ yarn build yarn run v1.22.19 $ next build info - Linting and checking validity of types
unhandledRejection file:///C:/Users/APPWRK/Desktop/rethink-2.0/rethink-next-docs-template/node_modules/nextra/dist/file-system.mjs:2 import { findPagesDir, existsSync } from "next/dist/lib/find-pages-dir.js"; ^^^^^^^^^^ SyntaxError: Named export 'existsSync' not found. The requested module 'next/dist/lib/find-pages-dir.js' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:
import pkg from 'next/dist/lib/find-pages-dir.js'; const { findPagesDir, existsSync } = pkg;
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.