Fix: Storybook 6.5.x Yarn PnP preset loading issue #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm sorry for the noise @hipstersmoothie but I'm back again as my previous attempt #187 didn't fix the failed preset loading in Storybook 6.5.x with yarn PnP.
I now believe the problem is two parts... one is the reference to
storybook-dark-mode/register
in preset.js and the other is a lack of an ESM build. To solve it I referred to thestorybook-addon-kit
github template and updated the following things to match the latest version of the template:register.js
in favour ofpreset.js
register.tsx
tomanager.tsx
and update preset.js to point to thedist/esm/manager
tsconfig.json
To test these changes I published this branch to a local verdaccio NPM registry and updated the repository where I can repro the issue to use the local published version. I've since introduced these changes to a
yarn patch
in our repo and everything is working as expected. 🥳I'm not sure if replacing
register.js
withpreset.js
is a breaking change or not for older versions of storybook. 🤔📦 Published PR as canary version:
3.0.0-canary.191.4282.0
✨ Test out this PR locally via: