Skip to content

Build errors when --out-dir includes dot in path segment #8135

@mfaux

Description

@mfaux

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

When calling npm run build -- --out-dir, if the directory contains a path segment with a dot ., the build fails with errors.

For example, the directory build/product/6.0/ causes errors.

Reproducible demo

No response

Steps to reproduce

Tested using git bash on Windows 10.

  1. Create a new docusaurus site:
    npx create-docusaurus@latest my-website classic
    
  2. Go to my-website and run:
    npm run build -- --out-dir "build/product/6.0/"
    

Expected behavior

The site builds correctly at the directory build/product/6.0/, relative to the docusaurus project.

Actual behavior

The results:

$ npm run build -- --out-dir "build/product/6.0/"

> [email protected] build
> docusaurus build --out-dir build/product/6.0/

[INFO] [en] Creating an optimized production build...

✔ Client


● Server █████████████████████████ sealing (92%) asset processing
 RealContentHashPlugin

[ERROR] Error: EISDIR: illegal operation on a directory, open 'C:\temp\my-website\build\product\6.0'
[ERROR] Unable to build website for locale en.
[ERROR] Error: EISDIR: illegal operation on a directory, open 'C:\temp\my-website\build\product\6.0'
[INFO] Docusaurus version: 2.1.0
Node version: v18.9.0

The build output is partially successful, but is missing the docs and img directories:

image

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used: 2.1.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Node .js 18.9.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions