-
Notifications
You must be signed in to change notification settings - Fork 94
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
Docusaurus Build fails when all @docusaurus/plugin-content-docs instances have custom ids #211
Comments
Are you using versioned docs? if not, try to downgrade this theme to 0.26.x. This issue is probably a regression introduced in v0.27.0 when implementing versioned docs. We will try to fix it later. |
Thanks @weareoutman :) I'm going to stay on 0.26.1 until then. |
Thanks for reporting, can you share your config about how you're using custom ids? |
Essentially I have this in my config which causes the error:
Seems like this piece of code that got introduced causes the problem:
Workaround that works with
But is not what I need as in other custom plugins I use the custom ids. |
I added a fix for this I think in #205, didn't feel worth it to fix in the old solution that is already not working. |
This issue seems not to be fixed yet |
There is still an issue when the first docs instance has an |
I am running into the same error message . I am not using plugins any where in the config
As a newbie to Docusaurus and react.js, please share the required configuration for themes: [
// ... Your other themes.
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
// For Docs using Chinese, The `language` is recommended to set to:
// ```
// language: ["en", "zh"],
// ```
},
],
], |
@ivishalgandhi You should try the suggestion above:
|
@weareoutman Thank you. I am not using plugins anywhere in the docusaurus.config.js. how and where should I use above configuration. |
@ivishalgandhi Can you share your full |
@weareoutman this is blog only config ; docs is set to false /** @type {import('@docusaurus/types').Config} */
const config = {
title: '',
tagline: '',
url: '',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/vishal.png',
organizationName: '', // Usually your GitHub org/user name.
projectName: ', // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
themes: [
// ... Your other themes.
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
// For Docs using Chinese, The `language` is recommended to set to:
// ```
// language: ["en", "zh"],
// ```
},
],
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: false,//{
// sidebarPath: require.resolve('./sidebars.js'),
// // Please change this to your repo.
// // Remove this to remove the "edit this page" links.
// // editUrl:
// // 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// },
blog: {
// routeBasePath: '/', // Set this value to '/'.
blogSidebarTitle: 'All posts',
path: './blog',
routeBasePath: '/',
blogSidebarCount: 'ALL',
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'The Data Column',
logo: {
alt: 'logo',
src: 'img/vishal.png',
},
items: [
// {
// type: 'doc',
// docId: 'intro',
// position: 'left',
// label: 'About',
// },
{ to: 'about', label: 'About', position: 'left' },
{
href: 'https://github.com/ivishalgandhi',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
copyright: `Copyright © ${new Date().getFullYear()} Vishal Gandhi. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['powershell', 'csharp', 'docker', 'bicep'],
},
}),
};
module.exports = config;
|
@ivishalgandhi OK I see, first try setting themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
indexDocs: false,
},
],
], |
✖ Server
Compiled with some errors in 8.35s
[ERROR] Docusaurus server-side rendering could not render static page with path /404.html.
[ERROR] Docusaurus server-side rendering could not render static page with path /about.
[ERROR] Docusaurus server-side rendering could not render static page with path /archive.
[ERROR] Docusaurus server-side rendering could not render static page with path /docker-sbom.
[ERROR] Docusaurus server-side rendering could not render static page with path /local-home-lab.
[ERROR] Docusaurus server-side rendering could not render static page with path /markdown-page.
[ERROR] Docusaurus server-side rendering could not render static page with path /search.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/dnsmasq.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/docker.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/docker-desktop.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/lab.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/nginx.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/reverse-proxy.
[ERROR] Docusaurus server-side rendering could not render static page with path /tags/sbom.
[ERROR] Docusaurus server-side rendering could not render static page with path /.
Error: Docusaurus plugin global data not found for "docusaurus-plugin-content-docs" plugin with id "default". |
@ivishalgandhi ok, I have just reproduced it. It happens when docs disabled. Will fix it later |
@weareoutman yes . thank you |
@ivishalgandhi Fixed in v0.30.1. P.S. you still need to set |
@weareoutman Thank you. build worked, but search is just spinning, not getting content. themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
indexDocs: false,
indexBlog: true,
blogRouteBasePath: "./blog"
},
],
], |
@ivishalgandhi I think you should set |
@weareoutman works fine |
Is this issue resolved? I just set up a clean install of docusaurus with plugins: [
[
"@docusaurus/plugin-content-docs",
{
id: "default", // had to set this to default (or remove it, which is equivalent), other values crashed the site
path: "my-path",
routeBasePath: "my-base-path",
sidebarPath: require.resolve("./sidebars.js"),
},
],
], Using an
|
@aryzing Try this option |
Hi,
when I tried to update to
0.27.0
my build failed because of the following error:also in the dev server I get the following error:
In my project I'm using custom ids for all instances of
@docusaurus/plugin-content-docs
.When I remove the custom plugin id for one instance everything works as expected. In my case it would be great if I could still continue to use custom ids for all my plugin instances.
The text was updated successfully, but these errors were encountered: