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

Github domain(githubHost) is undefined in Vercel #140

Open
UnschooledGamer opened this issue Apr 8, 2024 · 2 comments
Open

Github domain(githubHost) is undefined in Vercel #140

UnschooledGamer opened this issue Apr 8, 2024 · 2 comments

Comments

@UnschooledGamer
Copy link

UnschooledGamer commented Apr 8, 2024

I'm hosting an api docs at vercel and noticed that go to source code link has Github Domain(githubHost) is displayed as undefined, the url it gave: https://undefined/parasop/poru/blob/main/src/Player/Connection.ts#L61.
Whereas it works completely fine locally.

While searching in the source code of this repo, I found this.

Do I need to provide the githubHost in the docusaurus config?
I did not provide it as the docusaurus docs said:

The hostname of your server. Useful if you are using GitHub Enterprise. You don't need this if you are not using the docusaurus deploy command.

Versions(via npm list)

website@0.0.0 /workspaces/poru/website
├── @docusaurus/core@3.2.1
├── @docusaurus/module-type-aliases@3.2.1
├── @docusaurus/preset-classic@3.2.1
├── @docusaurus/tsconfig@3.2.1
├── @docusaurus/types@3.2.1
├── @mdx-js/react@3.0.1
├── clsx@2.1.0
├── docusaurus-plugin-typedoc-api@4.2.0
├── prism-react-renderer@2.3.1
├── react-dom@18.2.0
├── react@18.2.0
└── typescript@5.2.2
Docusaurus Config

import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import path from 'path';

const config: Config = {
  title: 'Poru',
  tagline: 'A stable and powerful Lavalink client with some best features',
  favicon: 'img/poru.png',
  trailingSlash: false,
  // Set the production url of your site here
  url: 'https://your-docusaurus-site.example.com',
  // Set the /<baseUrl>/ pathname under which your site is served
  // For GitHub pages deployment, it is often '/<projectName>/'
  // Check if it's running inside github actions environment or locally
  baseUrl: process.env.previewBaseURL ? process.env.previewBaseURL : ((!process.env.GITHUB_ACTIONS || !process.env.CI) ? '/' : '/poru'),

  // GitHub pages deployment config.
  // If you aren't using GitHub pages, you don't need these.
  organizationName: 'parasop', // Usually your GitHub org/user name.
  projectName: 'poru', // 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'],
  },
  plugins: [
    [
    'docusaurus-plugin-typedoc-api',
      {
        projectRoot: path.join(__dirname, '..'),
        packages: [{
          path: ".",
          entry: {
            index: "index.ts",
          }
        }],
        gitRefName: 'main',
        readmes: true,
        // minimal: ,
        debug: true,
        // typedocOptions: {
        //   entryPoints: ['../../index.ts'],
        // }
        sidebarCollapsed: false,
      },
    ],
  ],
  presets: [
    [
      'classic',
      {
        docs: {
          sidebarPath: './sidebars.ts',
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          // sidebarCollapsed: false,
          sidebarCollapsible: false,
        },
        blog: false,  // not used for this project
        theme: {
          customCss: './src/css/custom.css',
        },
      } satisfies Preset.Options,
    ],
  ],

  themeConfig: {
    // Replace with your project's social card
    image: 'img/poru.png',
    colorMode: {
      defaultMode: 'dark',
      respectPrefersColorScheme: true
    },
    navbar: {
      title: 'Poru',
      logo: {
        alt: 'Poru Logo',
        src: 'img/poru.png',
      },
      items: [
        {
          href: 'https://github.com/parasop/poru',
          label: 'GitHub',
          position: 'right',
        },
        {
          to: 'api',
          label: 'API',
          position: 'left',
          sidebarId: 'apiSidebar',
          // type: "autogenerated",
        },
      ],
    },
    docs: {
      sidebar: {
        autoCollapseCategories: false,
      },
    },
    footer: {
      style: 'dark',
      links: [
        {
          title: 'Docs',
          items: [
            {
              label: 'Overview',
              to: '/api',
            },
            {
              label: 'Poru Music (Example)',
              to: 'https://github.com/parasop/poru-example',
            },
          ],
        },
        {
          title: 'Community',
          items: [
            {
              label: 'Npm',
              href: 'https://www.npmjs.com/package/poru',
            },
            {
              label: 'Discord',
              href: 'https://discord.com/invite/Zmmc47Nrh8',
            },
            {
              label: 'GitHub',
              href: 'https://github.com/parasop/poru',
            },
          ],
        },
        {
          title: 'More',
          items: [
            {
              label: 'Donate',
              href: 'https://ko-fi.com/parasop',
            },
          ],
        },
      ],
      copyright: `Copyright © ${new Date().getFullYear()} Poru. Built with Docusaurus. Configured By UnschooledGamer`,
    },
    prism: {
      theme: prismThemes.github,
      darkTheme: prismThemes.dracula,
    },
  } satisfies Preset.ThemeConfig,
};

export default config;

Thanks.

@UnschooledGamer
Copy link
Author

@milesj Please have a eye here.

@milesj
Copy link
Owner

milesj commented May 4, 2024

I'm not entirely sure what the correct fix is here.

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

No branches or pull requests

2 participants