question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docusaurus-start doesn't work with projects that contain "pages" in their path

See original GitHub issue

🐛 Bug Report

Dev server crashes on file copy of files that contain pages in their path.

❯ yarn start
yarn run v1.19.1
warning package.json: No license field
$ docusaurus-start
LiveReload server started on port 35729
Docusaurus server started on port 3000
Error: ENOENT: no such file or directory, copyfile '/some_project/gitlab-pages/website/pages/en/index.js' -> '/some_project/gitlab-pages/website/node_modules/docusaurus/lib/pages/website/'
    at Object.copyFileSync (fs.js:1801:3)
    at copyFile (/some_project/gitlab-pages/website/node_modules/fs-extra/lib/copy-sync/copy-sync.js:68:8)
    at onFile (/some_project/gitlab-pages/website/node_modules/fs-extra/lib/copy-sync/copy-sync.js:53:25)
    at getStats (/some_project/gitlab-pages/website/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
    at startCopy (/some_project/gitlab-pages/website/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
    at handleFilterAndCopy (/some_project/gitlab-pages/website/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)
    at Object.copySync (/some_project/gitlab-pages/website/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)
    at /some_project/gitlab-pages/website/node_modules/docusaurus/lib/server/server.js:286:10
    at Layer.handle [as handle_request] (/some_project/gitlab-pages/website/node_modules/express/lib/router/layer.js:95:5)
    at next (/some_project/gitlab-pages/website/node_modules/express/lib/router/route.js:137:13)

server.js grabs an incorrect path:

      // copy into docusaurus so require paths work
      const userFileParts = userFile.split(`pages${sep}`);
      let tempFile = join(__dirname, '..', 'pages', userFileParts[1]);
      tempFile = tempFile.replace(
        path.basename(file),
        `temp${path.basename(file)}`,
      );
      mkdirp.sync(path.dirname(tempFile));
      fs.copySync(userFile, tempFile);

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. mkdir -p bug/gitlab-pages
  2. cd bug/gitlab-pages
  3. npx docusaurus-init
  4. cd website
  5. yarn start

Expected behavior

Dev server should start successfully.

Actual Behavior

Dev server doesn’t start.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Boluwatifehcommented, Sep 28, 2020

Ohh @slorber I’m deeply sorry about what happened. So there’s no fix for the issue until a beta us being released?

0reactions
Boluwatifehcommented, Sep 28, 2020

Okay, I’d do that right away. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deployment - Docusaurus
Deploy your Docusaurus app for production on a range of static site hosting services.
Read more >
Routing - Docusaurus
Docusaurus' routing system follows single-page application conventions: one ... If the path doesn't have an extension, it is a URL path.
Read more >
Manual migration | Docusaurus
This manual migration process should be run after the automated migration process, to complete the missing parts, or debug issues in the ......
Read more >
CLI - Docusaurus
Do not open automatically the page in the browser. --config, undefined, Path to Docusaurus config file, default to [siteDir]/docusaurus.config.
Read more >
Build and deploy a documentation website using Docusaurus 2
How to get started with Docusaurus. How to install it locally on your computer, how to create new documents and blogs, how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found