Skip to content

[Bug]: Error running build-storybook in folders with spaces (Mac) #32778

@lmartorella

Description

@lmartorella

Describe the bug

Get the Angular sample and run it in a folder with spaces.

The build fail with:

[10:17:53] Provided source folder <part of the path> was not found in the current directory

The culprit is the execaCommandSync([command, ...args].join(' ') line that flatten down the arguments and join them with spaces before passing it to the execa third-party lib.

The context.workspaceRoot value in run-compodoc.ts seems to be an absolute path, so the issue impacts the parent checkout path, and not only the project structure.

Reproduction link

https://storybook.js.org/tutorials/intro-to-storybook/angular/en/get-started/

Reproduction steps

Checkout the sample in a folder with spaces and run build.

System

Storybook Environment Info:

  System:
    OS: macOS 15.7.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.19.0 - ~/.nvm/versions/node/v22.19.0/bin/node
    npm: 10.9.3 - ~/.nvm/versions/node/v22.19.0/bin/npm <----- active
    pnpm: 10.17.1 - ~/.nvm/versions/node/v22.19.0/bin/pnpm
  Browsers:
    Chrome: 141.0.7390.108
    Safari: 26.0.1
  npmPackages:
    @storybook/addon-a11y: 9.1.13 => 9.1.13 
    @storybook/addon-links: 9.1.13 => 9.1.13 
    @storybook/addon-styling-webpack: 2.0.0 => 2.0.0 
    @storybook/angular: 9.1.13 => 9.1.13 
    storybook: 9.1.13 => 9.1.13 
    storybook-css-modules: 1.0.8 => 1.0.8

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions