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

Fixed paths in generated main.cjs for the default sandbox on Windows #20724

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Fixed paths in generated main.cjs for the default sandbox on Windows #20724

merged 1 commit into from
Jan 24, 2023

Conversation

Dschungelabenteuer
Copy link
Member

@Dschungelabenteuer Dschungelabenteuer commented Jan 22, 2023

See relevant discussion on Discord

When generating the default sandbox on a Windows environment, it creates Windows paths in the output main.cjs. Those paths are not being resolved into absolute paths from Vite, preventing the example Storybook from starting.

{
    directory: "../template-stories\\addons\\actions",
    titlePrefix: "addons\\actions",
    files: "**/*.@(mdx|stories.@(js|jsx|ts|tsx))"
}
previewAnnotations: [
  ".\\src\\stories\\components",
  "./template-stories\\lib\\store\\preview.ts",
  "./template-stories\\addons\\toolbars\\preview.ts"
],

image

What I did

I simply wrapped several paths with slash so that it actually uses POSIX paths

How to test

  1. Run the default sandbox yarn install on Windows
  2. See if it works out of the box!

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@ndelangen ndelangen merged commit dc453c1 into storybookjs:next Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants