Skip to content

Commit 27287cf

Browse files
authored
Fix "Error: require() of ES Module" when running yarn dev inside docs (orval-labs#2709)
* fix get-intrinsic bug: get-intrinsic v1.3.x depends on async-function which is an ESM-only module, but get-intrinsic is still trying to use require() on it * set outputFileTracingRoot to not use lockfile in parent dir, but the one in docs folder * use node 22 for docs * run yarn format
1 parent 89c80f1 commit 27287cf

File tree

4 files changed

+6055
-8261
lines changed

4 files changed

+6055
-8261
lines changed

docs/.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 22.21.1

docs/next.config.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
import type { NextConfig } from 'next';
2-
import rehypeSlug from 'rehype-slug';
2+
import createMDX from '@next/mdx';
3+
import recmaNextjsStaticProps from 'recma-nextjs-static-props';
34
import rehypeAutolinkHeadings, {
4-
Options as AutolinkOptions,
5+
type Options as AutolinkOptions,
56
} from 'rehype-autolink-headings';
7+
import rehypeSlug from 'rehype-slug';
8+
import rehypeUnwrapImages from 'rehype-unwrap-images';
69
import remarkEmoji from 'remark-emoji';
10+
import remarkFrontmatter from 'remark-frontmatter';
711
import remarkGfm from 'remark-gfm';
812
import remarkImages from 'remark-images';
9-
import rehypeUnwrapImages from 'rehype-unwrap-images';
10-
import remarkToc, { Options as TocOptions } from 'remark-toc';
11-
import remarkFrontmatter from 'remark-frontmatter';
1213
import remarkMdxFrontmatter, {
13-
RemarkMdxFrontmatterOptions,
14+
type RemarkMdxFrontmatterOptions,
1415
} from 'remark-mdx-frontmatter';
15-
import createMDX from '@next/mdx';
16-
import recmaNextjsStaticProps from 'recma-nextjs-static-props';
16+
import remarkToc, { type Options as TocOptions } from 'remark-toc';
1717

1818
const nextConfig: NextConfig = {
1919
// Support MDX files as pages:
2020
pageExtensions: ['md', 'mdx', 'tsx', 'ts', 'jsx', 'js'],
21+
outputFileTracingRoot: __dirname,
2122
rewrites: async () => [
2223
{
2324
source: '/docs{/}?',

docs/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"author": "Jared Palmer <jared@palmer.net>",
55
"license": "MIT",
66
"type": "module",
7+
"resolutions": {
8+
"get-intrinsic": "1.2.7"
9+
},
710
"scripts": {
811
"dev": "next dev --webpack",
912
"build": "next build --webpack && yarn sitemap",
@@ -66,6 +69,7 @@
6669
"node": "22.x"
6770
},
6871
"volta": {
69-
"node": "20.19.4"
70-
}
72+
"node": "22.x"
73+
},
74+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
7175
}

0 commit comments

Comments
 (0)