[BUG] Duplicate routes with embedded sidebar
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- documentation
Research direction
Reproduce the route warning with docusaurus.config.js, sidebar-nil.js, and the nil/reference/test.md structure using Docusaurus 3.x. Trace how the embedded sidebar and generated reference routes are created; done means the site renders without duplicate routes in this configuration.
Written by the indexing model from the issue text.
Description
Issue
The normal flow of configuring and using the plugin results in receiving the following error when using Docusaurus 3.x.
[WARNING] Duplicate routes found!
- Attempting to create page at \nil\reference\json-rpc-api, but a page already exists at this route.
This could lead to non-deterministic routing behavior.
As a result of this error, the entire site fails to render.
Steps to reproduce
docusaurus.config.js:
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config
import { themes as prismThemes } from 'prism-react-renderer';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
/** @type {import('@docusaurus/types').Config} */
const config = {
title: '=nil; Foundation Documentation Portal',
tagline: '',
favicon: 'img/nil-logo.png',
// Set the production url of your site here
url: 'https://docs.nil.foundation/',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: '=nil; Foundation', // Usually your GitHub org/user name.
projectName: 'docs.nil.foundation', // Usually your repo name.
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internationalization, 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'],
},
presets: [
[
"@metamask/docusaurus-openrpc/dist/preset",
/** @type {import('@metamask/docusaurus-openrpc/dist/preset').Options} */
({
docs: {
path: 'nil',
routeBasePath: 'nil',
sidebarPath: require.resolve("./sidebar-nil.js"),
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
openrpc: {
openrpcDocument: "https://metamask.github.io/api-specs/latest/openrpc.json",
path: "reference",
sidebarLabel: "JSON-RPC API",
},
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
plugins: [
[
'@docusaurus/plugin-content-docs',
{
id: 'zkllvm',
path: 'zkllvm',
routeBasePath: 'zkllvm',
sidebarPath: './sidebar-zkllvm.js'
}
],
[
'@docusaurus/plugin-content-docs',
{
id: 'proof-market',
path: 'proof-market',
routeBasePath: 'proof-market',
sidebarPath: './sidebar-proof-market.js'
}
],
[
'@docusaurus/plugin-content-docs',
{
id: 'crypto3',
path: 'crypto3',
routeBasePath: 'crypto3',
sidebarPath: './sidebar-crypto-3.js'
}
],
],
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
(
{
algolia: {
appId: 'KDQGY81FVN',
apiKey: '8ad8d801f2775ff3cf8c4433dfe290e4',
indexName: 'nil',
contextualSearch: true,
searchParameters: {},
searchPagePath: 'search',
insights: false,
},
colorMode: {
defaultMode: 'dark',
disableSwitch: true,
},
navbar: {
title: '=nil; Foundation',
logo: {
src: 'img/nil-logo.png',
},
items: [
{
position: 'left',
label: '=nil;',
to: '/nil/intro'
},
{
position: 'left',
label: 'zkLLVM',
to: '/zkllvm/overview/what-is-zkllvm'
},
{
position: 'left',
label: 'Proof Market',
to: '/proof-market/intro'
},
{
position: 'left',
label: 'Crypto3',
to: '/crypto3/intro'
},
],
},
footer: {
links: [
{
title: 'Community',
items: [
{
label: 'Discord',
to: 'https://discord.gg/KmTAEjbmM3'
},
{
label: 'GitHub',
to: 'https://github.com/nilfoundation'
},
{
label: 'Telegram',
to: 'https://t.me/nilfoundation'
}
],
}
],
style: 'dark',
copyright: `Copyright © ${new Date().getFullYear()} =nil; Foundation`,
},
prism: {
defaultLanguage: 'clike',
theme: prismThemes.vsDark,
darkTheme: prismThemes.vsDark,
},
}),
};
export default config;
sidebar-nil.js:
export default {
nil: [
{
type: 'category',
label: 'Introduction',
collapsed: false,
collapsible: true,
items: [
{
type: 'doc',
label: 'Overview',
id: 'intro',
},
{
type: 'doc',
label: 'Thesis',
id: 'thesis'
},
{
type: 'doc',
label: 'Principles',
id: 'principles'
}
]
},
{
type: 'category',
label: 'Core concepts',
collapsed: false,
collapsible: true,
items: [
{
type: 'doc',
label: 'Accounts',
id: 'core-concepts/accounts',
},
{
type: 'doc',
label: 'Transaction lifecycle',
id: 'core-concepts/transaction-lifecycle',
},
{
type: 'doc',
label: 'Shards and parallelized execution',
id: 'core-concepts/shards-parallel-execution',
},
{
type: 'doc',
label: 'Contract co-location',
id: 'core-concepts/contract-co-location',
},
]
},
{
type: 'category',
label: 'Specification',
collapsed: true,
collapsible: true,
items: [
{
type: 'doc',
label: 'Finality',
id: 'specification/finality',
},
{
type: 'doc',
label: 'Data availability',
id: 'specification/data-availability',
},
{
type: 'doc',
label: 'Sequencing',
id: 'specification/sequencing',
},
]
},
{
type: "category",
label: "Reference",
link: { type: "generated-index" },
items: [{ type: "autogenerated", dirName: "reference" }],
},
]
}
File structure:
root
-- nil
-- reference
-- test.md
Expected behaviour
The flow for configuring and using the plugin does not cause route duplication.
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetaMask/docusaurus-openrpc
-
team-wallet-api-platform
Difficulty 3/5 1-2 days Newbie friendliness 42/100
MetaMask/docusaurus-openrpc#71 · 1 comment ·
-
team-wallet-api-platform
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Handle notificationsOpenteam-wallet-api-platform
Difficulty 5/5 Over a week Newbie friendliness 25/100
MetaMask/docusaurus-openrpc#45 · 1 comment ·
All issues in MetaMask/docusaurus-openrpc
Similar issues
-
area/frontend area/v2 kind/bug priority/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kubeflow/notebooks#1498 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
P1
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SuruchBoss/Cwork#90 ·
-
bug cli service
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#3922 ·