Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Conversation

@rawrmonstar
Copy link
Contributor

@rawrmonstar rawrmonstar commented Feb 27, 2025

This is an alternative to #19 which keeps the commonjs. @JonahPlusPlus

preset.js is commonjs but the package.json says the package is esm, I believe this is the cause of the module not defined error. For what it's worth Storybook still relies on commonjs and other integrations also don't set type: "module" (e.g., https://github.com/storybookjs/storybook/blob/next/code/renderers/react/package.json)

I tested this locally and everything was working under Node 23.8.0

@JonahPlusPlus
Copy link
Collaborator

Nice catch, this is probably the cause. I'll test it and try to merge tomorrow or Saturday.

Modified versions of packages and dependencies in order to make sure they works across different versions of peer dependencies and was using the latest.
@JonahPlusPlus
Copy link
Collaborator

Bumped packages' patch version.

Since I have this moment to make some fixes, I also bumped some dependencies to their latest and relaxed some peer dependencies (e.g. the previous version would have had dependency resolution issues with vite 6).

It works for me so I'm good with merging, but since the previous version also worked for me, could @JellyBrick or @spuxx-dev check to see if this branch works for them?

@Chudesnov
Copy link

This needs to be merged ASAP, as the latest Node 20 LTS version, not just Node 22 and 23, also tries to load packages with type: "module" as ESM when using require.

@pecoram
Copy link

pecoram commented Apr 4, 2025

JonahPlusPlus Why has this pr not been released yet?

@JonahPlusPlus JonahPlusPlus merged commit b534619 into storybookjs:main Apr 4, 2025
5 checks passed
@JonahPlusPlus
Copy link
Collaborator

Sorry, I didn't get a notification for the thumbs-up. Merged and releasing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants