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
- mkdir -p bug/gitlab-pages
- cd bug/gitlab-pages
- npx docusaurus-init
- cd website
- yarn start
Expected behavior
Dev server should start successfully.
Actual Behavior
Dev server doesn’t start.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ohh @slorber I’m deeply sorry about what happened. So there’s no fix for the issue until a beta us being released?
Okay, I’d do that right away. Thanks