Fix preset.js 'module not defined'#20
Fix preset.js 'module not defined'#20JonahPlusPlus merged 2 commits intostorybookjs:mainfrom rawrmonstar:fix-module-is-not-defined
Conversation
|
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.
|
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? |
|
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 |
|
JonahPlusPlus Why has this pr not been released yet? |
|
Sorry, I didn't get a notification for the thumbs-up. Merged and releasing. |
This is an alternative to #19 which keeps the commonjs. @JonahPlusPlus
preset.jsis commonjs but thepackage.jsonsays the package is esm, I believe this is the cause of themodule not definederror. 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