Sergey Filonov
Sergey Filonov

Reputation: 1

Docusaurus site did not load properly

I can't launch а local site from the build folder view file index.html. When I enter the "build" command in the terminal and the site, these messages.

in the terminal

on the website

My config

    const config = {
       title: "qwerty",
       tagline: "Dinosaurs are cool",
       url: "https://your-docusaurus-test-site.com",
       baseUrl: "/C:/Users/qwerty/Desktop/Develop/qwerty/build/index.html/",
       onBrokenLinks: "throw",
       onBrokenMarkdownLinks: "warn",
       favicon: "img/favicon.ico",
    
       // GitHub pages deployment config.
       // If you aren't using GitHub pages, you don't need these.
       organizationName: "facebook", // Usually your GitHub org/user name.
       projectName: "docusaurus", // 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"],
       },
presets: [
      [
         "classic",
         /** @type {import('@docusaurus/preset-classic').Options} */
         ({
            docs: {
               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: {
               showReadingTime: true,
               // 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/",
            },
            theme: {
               customCss: require.resolve("./src/css/custom.css"),
            },
         }),
      ],
   ],}

Upvotes: 0

Views: 3138

Answers (1)

D.Kastier
D.Kastier

Reputation: 3025

The problem is at your baseUrl parameter.

Replace it from

baseUrl: "/C:/Users/qwerty/Desktop/Develop/qwerty/build/index.html/",

to

baseUrl: "/",

and it should work.


From the docs:

Base URL for your site. Can be considered as the path after the host. For example, /metro/ is the base URL of https://facebook.github.io/metro/. For URLs that have no path, the baseUrl should be set to /. This field is related to the url field. Always has both leading and trailing slash.

Upvotes: 2

Related Questions