Closed Jonatthu closed 2 years ago
@Jonatthu none of the code here even mentions document, if you can provide a demo project so I can test, happy to help, but given I have yet to try this addon in a react native env, I'm not sure how to help without a lot of effort on my part.
I can confirm it doesn't work on storybookjs/react-native.
I've installed the addon and added it to the addons list on main.js
. The Storybook bootstrap script will add an import to the storybook.requires.js
auto-generated file:
import "storybook-addon-apollo-client/register";
And then, it will fail to import from /register
when trying to run Storybook:
Unable to resolve "storybook-addon-apollo-client/register" from ".storybook/storybook.requires.js"
I've tried adding "moduleResolution": "node16"
to my "compilerOptions"
on tsconfig.json
as this addon is using package exports to map the register
export, but I've had no success at all. Still the same error message.
@Jonatthu , did you manage to make this work?
@marcosdiasdev if you can put a demo project together, I can see what I can do to get it working
Was anyone ever able to get this to work?
@pfcodes i don't have time to work on it, but if you do, I can cut a release.
This is now working in Storybook 8.4 without any hacks needed. Looks like the Storybook team refactored the internals so React Native Storybook behaves a lot more like web. The "Apollo Client" tab doesn't render in the add-ons panel, but its a step forward.
@pfcodes if you could put a basic project starter together, I'd be happy to look into it! I only initially created this addon from using create-react-app (back when that was defacto for storybook integration) but plan on adding first class support for vite/etc soon. I just haven't personally been using apollo-client so I haven't had much of a reason to maintain it, and zero sponsorships to help.
Currently it throws an error: