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

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

Closed
mbykovskyy opened this issue Nov 20, 2019 · 7 comments Β· Fixed by #2020
Closed

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

mbykovskyy opened this issue Nov 20, 2019 · 7 comments Β· Fixed by #2020
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers

Comments

@mbykovskyy
Copy link

πŸ› 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.

@mbykovskyy mbykovskyy added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Nov 20, 2019
@Boluwatifeh
Copy link

hi @endiliey i'm facing this issue, how do i fix it??

@slorber
Copy link
Collaborator

slorber commented Sep 28, 2020

@Boluwatifeh unfortunately he won't answer: https://v2.docusaurus.io/blog/2020/01/07/tribute-to-endi

I'm working on v2, which is not far from a stable release, so it's worth considering migrating. i18n, the last missing feature for beta/RC/GA, is coming soon.

@Boluwatifeh
Copy link

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

@slorber
Copy link
Collaborator

slorber commented Sep 28, 2020

I think this should work in v2 and you shouldn't wait for v2 beta to try using it as it's quite stable already.

v1 do not receive many bugfixes atm as I'm working only v2. If you want this fixed on v1 soon, the best way is likely to send a PR.

@Boluwatifeh
Copy link

@slorber I'm facing the issue with v2. I tried running npm start after following the instructions from the docusaurus v2 website. I got the error "LiveReload server started on port 35729
Docusaurus server started on port 3000

@slorber
Copy link
Collaborator

slorber commented Sep 28, 2020

So you should open a separate issue with v2, and proper repro steps (ideally a github repo) and error messages.

This issue was for v1, so if you have it with v2, I need at least the error message from v2.

@Boluwatifeh
Copy link

Okay, I'd do that right away. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants