chromaui / learnstorybook.com

Static site and content for Storybook tutorials
https://storybook.js.org/tutorials/
MIT License
2.4k stars 440 forks source link

Unhandled Rejection (Error): Cannot load null or undefined font source: { "percolate": undefined }. Expected asset of type FontSource for fontFamily of name: "percolate" #534

Closed DohertyC12 closed 2 years ago

DohertyC12 commented 3 years ago

Does anyone have a working repo of the Storybook for RN? Unhandled Rejection (Error): Cannot load null or undefined font source: { "percolate": undefined }. Expected asset of type FontSource for fontFamily of name: "percolate"

To Reproduce

  1. Follow Storybook for RN tutorial https://storybook.js.org/tutorials/intro-to-storybook/react-native/en/get-started/ Links were out of date for Add Assets here - I found the closest but I think I'm missing some files: https://github.com/chromaui/learnstorybook-code/branches/master/src/assets/icon https://github.com/google/fonts/trunk/ofl/nunitosans assets/font
  2. Ran "yarn web" to start app in browser, "yarn storybook" to run Storybook in browser, got this error: × Unhandled Rejection (Error): Cannot load null or undefined font source: { "percolate": undefined }. Expected asset of type FontSource for fontFamily of name: "percolate" loadFontInNamespaceAsync$ C:/Users/erdohert/Repos/src/Font.ts:96 93 | return await loadFontInNamespaceAsync(fontFamilyOrFontMap, source); 94 | } 95 | 96 | async function loadFontInNamespaceAsync( 97 | fontFamily: string, 98 | source?: FontSource | null 99 | ): Promise {

System: Please paste the results of npx -p @storybook/cli@next sb info here. Environment Info:

System: OS: Windows 10 10.0.22000 CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz Binaries: Node: 14.15.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 92.0.4515.159 Edge: Spartan (44.22000.120.0), Chromium (92.0.902.84) npmPackages: @storybook/addon-actions: ^5.3 => 5.3.21 @storybook/addon-knobs: ^5.3 => 5.3.21 @storybook/addon-links: ^5.3 => 5.3.21 @storybook/addon-ondevice-actions: ^5.3.23 => 5.3.23 @storybook/addon-ondevice-knobs: ^5.3.25 => 5.3.25 @storybook/addon-storyshots: ^6.3.7 => 6.3.7 @storybook/react-native: ^5.3.25 => 5.3.25 @storybook/react-native-server: ^5.3.23 => 5.3.23

Context

jonniebigodes commented 2 years ago

Closing this in favor of #608 as to have only one place for the changes to the tutorial.