Describe the bug
I am trying to integrate storybook and yarn pnp, without success.
To Reproduce
create react app,
setup storybook as in the tutorial
activate yarn pnp
run storybook
you can also see this on thix example project https://github.com/marco-silva0000/cra-test-pnp-storybook
Currently you get this error http://dpaste.com/1W0DQ1Y, which is the bug #5942 fixed in #5817 but probably reverted by #6899
In the project linked above there is a wip for a preset to support pnp without TS, but it is now blocked because of the @emotion/core issue.
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
The biggest show stopper (I had PnP working) is this PR https://github.com/storybookjs/storybook/commit/4d747663887ab7815ea534f2e0a33a97447866a9#diff-12679c86a71ee9f4267519c0607ebd60 which uses resolve-from. The problem is PnP relies on symlinks for some packages, @storybook/theming being one of them. Since resolve-from passing the resolved destination of the symlink to Module._resolveFilename it breaks PnP.
I'm curious why this code change was needed? resolve-from allows you to choose the folder you resolve the package against. However, in the code the folder is the same that require.resolve would provide except for following the symlink first. For standard node resolution following the symlink first shouldn't change anything but it does for PnP. I've altered the code to use require.resolve in my package cache and it successfully lets me use pnp with storybook.
Looks like yarn does support enhanced-resolve which could do the same thing.
@marco-silva0000 @lroling8350 Would either of you be interested in opening a PR switching us from resolve-from to enhanced-resolve?
I'll play with this and get a PR up. I am curious what condition/scenario altered the code from using the standard require.resolve to the resolve-from. I would like to ensure i don't break that use case. I bring this up because resolve-from is useful if you want to resolve against a different directory than the one the current file exists in, however, the current implementation with resolve-from uses the same dir that require.resolve would use. Reading through the issue that led to the PR resolve locally pr I don't quite follow how it fixed the problem and no one listed projects that were fixed by this solution to test against.
@lroling8350 I'd be happy to your support line on discord for this
https://discord.gg/sMFvFsG
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Any news on this ? @lroling8350 @ndelangen ?
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
What's the status on this?
cc @igor-dv wasn't there a preset for this in the works?
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!