-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Undefined is not a function when rendering StorybookUIRoot #471
Comments
@allisonadam81 can you provide a reproduction? |
I can hopefully next week - I've been looking into this over the past 2 days. It looks like it has to do with react-native-safe-area-context library introducing some breaking changes in v4, and my app is still on 3 and it has to be. Storybook 5.3 is working great, however. |
Update - it looks like storybookUIRoot is not returning a valid react component. Still working on why. |
@allisonadam81 any update here? Believe I've run into the same bug:
| @dannyhw happy to report as a separate issue? |
@henrymoulton I can't really say until I know how to reproduce the problem. Are you able to create a reproduction? |
I ran into this issue months ago and was able to resolve it recently. @dannyhw After much trial and error, I discovered using Babel's module-resolver plugin with the option Here's the relevant section of my plugins: [
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
'@babel/plugin-proposal-optional-catch-binding',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
[
'module-resolver',
{
root: ['./'],
extensions: [
'.ios.js',
'.android.js',
'.js',
'.jsx',
'.ts',
'.tsx',
'.json',
],
alias: {
'^@app/(.+)': './app/\\1',
'^@story/(.+)': './.storybook/\\1',
},
// cwd: 'packagejson' <---- REMOVED LINE
},
],
// React Native Dotenv
// https://github.com/goatandsheep/react-native-dotenv
[
"module:react-native-dotenv", {
"envName": "APP_ENV",
"moduleName": "@env",
"path": ".env",
"blocklist": null,
"allowlist": null,
"safe": false,
"allowUndefined": true,
"verbose": false
}
],
['react-native-reanimated/plugin'],
], @allisonadam81 @henrymoulton |
Wow! Thank you for this! Full points @Dappsters I'll try this out as my company is looking at picking back up our component library build soon. |
@henrymoulton , were you able to resolve this ?? I'm running into the same error |
@dannyhw , any idea about the above error that @henrymoulton mentioned ?? can you please help here. |
@SaiChand-Headout sorry to keep repeating myself but i really need a reproduction of the problem to know what the problem is |
@dannyhw , in an existing RN project, I just followed the steps from https://github.com/storybookjs/react-native?tab=readme-ov-file#existing-project and changed the app.tsx to render storybook, immediately it started crashing, if you need any particular versions i can provide with them as well. |
@SaiChand-Headout if you can create a public project with the minimal changes to recreate the same error that would make it very easy to help you. Otherwise I just have examples of it working. |
Hey @dannyhw , it's working in a new fresh app, figured out the issue in our app as well, the registery was pointing to codepush component in index.js which was causing the issue. When i changed the imports, it started working, thanks a lot |
Describe the bug
RN 0.66.5
Storybook RN 6.5.18.
When rendering the StorybookUIRoot, I receive a react native render error "undefined is not a function".
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To get the default story from the folder put into my repo by the storybook installation.
Screenshots
System:
Environment Info:
System:
OS: macOS 13.3
CPU: (8) x64 Apple M1
Binaries:
Node: 16.20.0 - ~/Desktop/Howl/Howl.Alert/node_modules/.bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
Browsers:
Chrome: 112.0.5615.137
Safari: 16.4
npmPackages:
@storybook/addon-actions: ^6.5.16 => 6.5.16
@storybook/addon-controls: ^6.5.16 => 6.5.16
@storybook/addon-ondevice-actions: ^6.5.3 => 6.5.3
@storybook/addon-ondevice-controls: ^6.5.3 => 6.5.3
@storybook/react-native: ^6.5.3 => 6.5.3
The text was updated successfully, but these errors were encountered: