Skip to content

Rename preset.js to preset.cjs#41

Open
unional wants to merge 3 commits intoigrlk:mainfrom
unional:patch-1
Open

Rename preset.js to preset.cjs#41
unional wants to merge 3 commits intoigrlk:mainfrom
unional:patch-1

Conversation

@unional
Copy link
Copy Markdown

@unional unional commented Oct 7, 2025

This repo is esm (type: module), so the .js extension is treated as esm, not cjs.

this causes the storybook build failure in 9.1.10

This repo is esm (`type: module`), so the `.js` extension is treated as esm, not cjs.

this causes the storybook build failure in 9.1.10
@igrlk
Copy link
Copy Markdown
Owner

igrlk commented Nov 1, 2025

Hey @unional. I tested the addon with 9.1.16 and couldn't reproduce the issue. Can you upgrade to storybook@9.1.16 and see if it solves the problem?

I also just shipped a new version of the addon storybook-addon-test-codegen@3.0.0 which is compatible with storybook@10.

@unional
Copy link
Copy Markdown
Author

unional commented Nov 2, 2025

If you test is within the repo, you won't able to repro it as Vite uses rollup for local code and esbuild on dependencies.

I also need to update my addons to support v10 but that will take a while.
It would be great if you can address this in v2 so that it will work on Storybook v9.

In this PR, I change the filename as that's the easier way to fix the issue.
As Storybook v10 is ESM only, you can also change the content to ESM instead. But since you already release v3, you can probably keep this and release it in a v2 branch.

@igrlk
Copy link
Copy Markdown
Owner

igrlk commented Nov 2, 2025

I initialized a new react-vite project with storybook@9.1.16 outside of this repo, and everything worked fine. Please add a minimal reproducible repo, this way I can:

  1. Reproduce the error that I couldn't get locally on a brand new project
  2. Apply your fix and verify it fixes the problem without causing any side effects

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