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

TypeError: The "from" argument must be of type string. Received undefined with Docusaurus >=3.6.0 #293

Open
chris48s opened this issue Nov 10, 2024 · 1 comment · May be fixed by #294
Open

Comments

@chris48s
Copy link
Contributor

This is a new error with Docusaurus 3.6.x
You can reproduce fairly easily.

npx create-docusaurus-openapi my-website
cd my-website
npm start

will throw it.

I think that fundamentally this is happening because siteDir is not set in

options: {
admonitions: options.admonitions,
remarkPlugins,
rehypePlugins,
beforeDefaultRehypePlugins,
beforeDefaultRemarkPlugins,
markdownConfig: siteConfig.markdown ?? { mdx1Compat: {} },
metadataPath: (mdxPath: string) => {
if (mdxPath.startsWith(dataDir)) {
// The MDX file already lives in `dataDir`: this is an OpenAPI MDX
return mdxPath.replace(/(-content\.mdx?)$/, ".json");
} else {
// Standard resolution
const aliasedSource = aliasedSitePath(mdxPath, siteDir);
return join(dataDir, `${docuHash(aliasedSource)}.json`);
}
},
},

Maybe the fix is as simple as setting siteDir to a value like . in there? I haven't dug any further than that.

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

Successfully merging a pull request may close this issue.

1 participant