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

Fix preset.js 'module not defined' #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rawrmonstar
Copy link

@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?

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