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

Revert storybook config to CJS #873

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Conversation

askoufis
Copy link
Contributor

@askoufis askoufis commented Aug 15, 2023

sku storybook/sku build-storybook were failing on storybook>7.1.0, specifically when loading sku's storybook files (main.js which imports config.js). These files were both converts to ESM during the storybook 7 migration when support for ESM was added for main.js. However, as of storybook 7.1.0, it appears that storybook no longer runs esbuild/register on files from node_modules, which is likely how they were supporting ESM config, thus breaking the way sku injects storybook config.

Short of changing how sku injects its storybook config (potentially emitting config to a .storybook folder and gitignoring it), the easiest solution in the meantime is to just revert these configs back to CJS.

NOTE: I wasn't able to replicate this within sku's storybook fixture. Upgrading past storybook 7.1.0 results in the storybook CLI attempting to do things, but never finishing and showing no errors. However, I have replicated this issue in a sku consumer's app, and validated that the fix works.

@askoufis askoufis requested a review from a team as a code owner August 15, 2023 07:20
@changeset-bot
Copy link

changeset-bot bot commented Aug 15, 2023

🦋 Changeset detected

Latest commit: 1a3b560

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sku Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@askoufis askoufis merged commit 1a9598a into master Aug 15, 2023
@askoufis askoufis deleted the revert-esm-storybook-config branch August 15, 2023 23:44
@seek-oss-ci seek-oss-ci mentioned this pull request Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants