-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: 'Plugin 0 provided an invalid property of "default"' when using with React Native + TypeScript #3897
Comments
the same error exist even without typescript |
I had the same problem. I had to add a custom .babelrc in my .storybook folder with the following code:
|
i have the same issue, in a new project with the same setup as @andycloke. @jimmytb's solution does not fix the error for me |
also bumping these dependencies seems to have fixed it for me:
|
That works for me too @swese44. Nice one! |
Same issue with me , I am runnig npm test, and getting same error |
same issue for me. i also changed presets as @jimmytb's solutions and also installed additional dependencies as said by @swese44. |
Also have the same issue. |
Is this issue solved for anyone? The only difference in my case is, Im using plain JS and not TS. |
I am having the same issue, I tried these solutions (as |
I was seeing this too on a new React Native (0.56) app, without TypeScript. As mentioned elsewhere, the issue stems from the fact that RN 0.56 uses babel core v7, whereas the yarn remove babel-core
yarn add -D @babel/[email protected] [email protected] This ensures that storybook uses the same version of babel core that RN is using to compile the app. The babel-core bridge package is necessary so that storybook 'sees' babel core v7 properly (see here for more details). |
Replace your package.json to exactly code bellow:
Restart your Metro bundle service and to be happy! |
@hersonrodrigues thank you, your code ended my 2-days struggling about starting react native normally |
@andycloke I am still stuck with the same issue with React Native (0.56) and typeScript, can you please help me out here is my config devDependencies - .babelrc Have tried the solution suggested by @fiznool, still haven't got it working. |
I've updated the |
Looks like the issue is unrelated to typescript, but to some kind of combination between RN, babel, and Storybook. |
@igor-dv I agree, i wanted try to use with a simple rn project. I just created one with react-native init. The rn itself is working i tried with ios, and the bundler working. After i just added the storybook with the cli, and i just started and i get the same error. |
Downgrading to |
The solution no longer work with |
For those still running into this issue, here are the steps i followed to get updated:
That should do it! Let me know if this helps! |
Specifically for React Native 0.57 |
@damianthekreeeytor I have tried your approach but it doesn't work. It is worth to mention I am using
And this is my package.json
|
@damianthekreeeytor I follow you steps, I was still facing some issues, then mannually changed the storybook babel dependencies that got installed. I'm now get rid of the error but the storybook is not working, I mean I cannot see any updates on the stories, like if the storybook server wasn't taking any chanes. Current setup version(As you can see very basic setup, just to get storybook running):
|
@ivansnek it seems like we have the same issue. Storybook watcher is working but it is simply not connected to the simulator. I have also tried to create a fresh react-native project (version 0.57), but no luck. |
Yep I also tried the same and 👎 |
@damianthekreeeytor You are a god amongst men. #3897 (comment) saved my butt |
@mcmar did you manage to make it work with React Native 0.57? If yes, can you please share how you did it? |
@raynor85 I just followed the directions in #3897 (comment) except for the |
@mcmar So I have tried to do exactly as @damianthekreeeytor and you did, but after |
@mcmar @damianthekreeeytor can you please share your |
@raynor85 No. Clearing your node modules in the last step is just a one-time thing. Actually, I don't think it's really necessary. It's just a precaution. I think it's really only necessary if you install a different version of node. Step 1 was the critical step for me that I was missing. |
I also had a few steps that I didn't include in here. I had to delete the |
Hey Guys I manage to get it working RN v0.57 and storybook,
So I modify my index.js to something like this:
With all this steps I was able to meke it run, I hope it helps |
Just i changed "babel-preset-react-native": "4.0.0" version and this issue is fixed. |
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, since this issue is relevant to #4011 I am closing this one. |
If you are reporting a bug or requesting support, start here:
Bug or support request summary
Failing to compile when trying to use with React Native + Typescript:
Steps to reproduce:
react-native init test --template typescript
cd test && node setup.js
getstorybook
storybook start -p 7007 --metro-config $PWD/rn-cli.config.js
yarn storybook
Please specify which version of Storybook and optionally any affected addons that you're running
Screenshots / Screencast / Code Snippets (Optional)
.babelrc:
.tsconfig:
The text was updated successfully, but these errors were encountered: