storybook: dist/cjs/server/options ERR_PACKAGE_PATH_NOT_EXPORTED in exports
Same for me as for @clover-omelnyk @shilman Can you please take a look?
I’m trying to use it with:
"next": "12.2.2",
"preact": "10.7.3",
"preact-render-to-string": "5.2.0",
"react": "npm:@preact/compat@^17.1.1",
"react-dom": "npm:@preact/compat@^17.1.1"
info @nrwl/storybook ^14.5.7 → ^14.6.0-beta.4
info @storybook/addon-essentials ~6.5.9 → ~7.0.0-alpha.23
info @storybook/builder-webpack5 ~6.5.9 → ~7.0.0-alpha.23
info @storybook/core-server ~6.5.9 → ~7.0.0-alpha.23
info @storybook/manager-webpack5 ~6.5.9 → ~7.0.0-alpha.10
info @storybook/react ~6.5.9 → ~7.0.0-alpha.23

P.s. 6.5.9 is throwing an error about:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /Users/klypalskyi/Documents/Techery/SunRider/sunrider/node_modules/react/package.json
_Originally posted by @Klypalskyi in https://github.com/storybookjs/storybook/issues/13099#issuecomment-1220018684_
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 14
- Comments: 15 (8 by maintainers)
Hellooooooo everyone!!!
I am very sad to report that the Nx executors do NOT work with Storybook 7 yet. That, however, does NOT mean that you cannot use Nx with Storybook 7!
What you can do is the following:
npx storybook@next upgrade --prereleaseto install Storybook v7, or just update manually.storybook/main.jsfiles - manually for now 😦apps/my-apporlibs/my-lib) and runnpx storybook devornpx storybook buildFollowing these steps, it should work.
Now, if you want to run the task via Nx, you can create a new
storybooktarget for your project using run-commands:Delete or rename your project’s
storybookandbuild-storybooktargetsRun:
So if your project is a library called
my-libthe command would be:libs/my-lib/project.json:And you can call this like:
NOTE: Please note that this is a temporary solution. And it might as well NOT WORK at all, at this stage. The Storybook v7 support for Nx is on the way. It’s not there yet. This is a temporary solution if you want to see it working.
Please please let me know if you have any questions.
@ndelangen @ild0tt0re the thing is that if you’re using Storybook 7, in my reproduction issue, I am just calling directly
npx storybook build, so I’m not using@nrwl/storybookat all!!! I am just calling directly thestorybook build, you see.So I’m not using the Nx executors you link above at all for Storybook 7.
Ohhhh I see the confusion. The error reported initially in this issue is a different error than the one I am having. The error posted in the issue is indeed due to these imports that @ild0tt0re is talking about. The two implementations of Nx need to be refactored, to use the new standalone build. I have not done that yet, and that’s the reason one cannot use the Nx executors with Storybook v7.
Now, the issue I am having is something totally different. 😃
@shilman same issue with storybook
7.0.0-beta.19in a Nx15.4.2monorepo.REPRO
pnpm nx storybook core-react-rollupERROR
+1, have the same issue (7.0.0-beta.0)