Skip to content

Uncaught Runtime ErrorsΒ #843

@SirPhemmiey

Description

@SirPhemmiey

Describe the bug

I am trying to integrate this package into my existing docusaurus documentation and i'm running into issues with running the docs. I get this error everytime i load/serve it up and sometimes as soon as i click on the sidebar that contains the API

Expected behavior

I expect it to work as usual. I expect it to load up the mdx generated pages

Current behavior

It's currently throwing an error. I've tried different combinations of versions, it's still not working.

Steps to reproduce

Screenshots

Screenshot 2024-06-21 at 14 07 12

Your Environment

First Version

 "@docusaurus/core": "3.4.0",
    "@docusaurus/preset-classic": "3.4.0",
    "@mdx-js/react": "^3.0.0",
    "prism-react-renderer": "2.3.0",
    "docusaurus-plugin-openapi-docs": "3.0.0-beta.10",
    "docusaurus-theme-openapi-docs": "3.0.0-beta.10",

Second Version

  "@docusaurus/core": ">=2.4.1 <=2.4.3",
    "@docusaurus/preset-classic": ">=2.4.1 <=2.4.3",
    "@mdx-js/react": "^1.6.22",
    "clsx": "^1.1.1",
    "docusaurus-plugin-openapi-docs": "2.1.0",
    "docusaurus-theme-openapi-docs": "2.1.0",

my docusaurus.config.js file


// import { themes as prismThemes } from 'prism-react-renderer';

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
  title: 'title',
  tagline: '',
  url: 'url',
  baseUrl: '/',
  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'warn',
  favicon: 'img/favicon.ico',

  // 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'],
  // },

  presets: [
    [
      'classic',
      /** @type {import('@docusaurus/preset-classic').Options} */
      ({
        docs: {
          sidebarPath: require.resolve('./sidebars.js'),
          // docRootComponent: '@theme/DocRoot',
          docLayoutComponent: '@theme/DocPage',
          docItemComponent: '@theme/ApiItem',
        },
        theme: {
          customCss: require.resolve('./src/css/custom.css'),
        },
      }),
    ],
  ],
  plugins: [
    [
      'docusaurus-plugin-openapi-docs',
      {
        id: 'docs', // plugin id
        docsPluginId: 'classic', // id of plugin-content-docs or preset for rendering docs
        config: {
          lebowski: {
            specPath: '../lebowski/open-api/adrequest-proxy-spec.yaml',
            outputDir: 'docs/ad-request-proxy/OpenAPI',
            sidebarOptions: {
              // optional, instructs plugin to generate sidebar.js
              groupPathsBy: 'tag', // group sidebar items by operation "tag"
            },
          },
        },
      },
    ],
  ],

  themeConfig:
    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
    ({
      navbar: {
        title: 'AdTech docs',
        logo: {
          alt: 'My Site Logo',
          src: 'img/logo.svg',
        },
        items: [
          {
            href: 'ref_link',
            label: 'GitHub',
            position: 'right',
          },
        ],
      },
      footer: {
        style: 'dark',
        links: [
          {
            title: 'Getting started',
            items: [
              {
                label: 'Getting started',
                to: '/docs/intro',
              },
            ],
          },
          {
            title: 'Github',
            items: [
              {
                label: 'AdTech monorepo',
                href: 'ref_link',
              },
              {
                label: 'Proxy Ads',
                href: 'ref_link',
              },
              {
                label: 'Proxy Events',
                href: 'ref_link',
              },
            ],
          },
          {
            title: 'Related documentation',
            items: [
              {
                label: 'Kevel API docs',
                to: 'https://dev.kevel.com/reference/request',
              },
            ],
          },
        ],
      },
      prism: {
        // theme: prismThemes.github,
        // darkTheme: prismThemes.dracula,
        theme: lightCodeTheme,
        darkTheme: darkCodeTheme,
      },
    }),
  themes: ['docusaurus-theme-openapi-docs'],
};

module.exports = config;

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions