Skip to content

[Bug]: If 'src' is in the path above the storybook repo core does not build #30403

Open
@boylec

Description

Describe the bug

'core' build process uses the replace method which causes things to fail if the storybook repo is in a path with 'src' above it on the local hard drive.

Reproduction link

Can't using storybook.new because its a pathing issue

Reproduction steps

  1. Clone storybook repo in ~/src/storybook
  2. Run yarn start

You will receive a build error and some files will be built to ~/dist/

This appears to be because of the use of .replace('src', 'dist') throughout some of the core prepare scripts against entry files. .replace will replace the first occurrence of 'src' with 'dist'.

To fix .replace should be replaced with a utility function the replaces last occurrence of 'src' with 'dist'

System

N/A

Additional context

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions