Skip to content
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

[font][plugin] handle no arguments #25138

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Conversation

alanjhughes
Copy link
Collaborator

Why

Closes ENG-10497
The plugin should handle the case where it is added but no options are passed.

How

Check if the props are defined.

Test Plan

Tested in sandbox app

@linear
Copy link

linear bot commented Oct 31, 2023

ENG-10497 expo-font config plugin should handle case where no options are passed in

yarn create expo my-app --template blanksdk-50
cd my-app
yarn expo install expo-font
yarn expo run:ios
$ yarn run v1.22.19
$ /Users/brentvatne/code/font-testing/node_modules/.bin/expo run:ios
$ CommandError: Cannot read properties of undefined (reading 'fonts')

This happens because installing expo-font adds a plugin with no options:

    "plugins": [
      "expo-font"
    ]

You can get around the error by doing this:

    "plugins": [
      [
        "expo-font",
        {}
      ]
    ]

We should handle the case where no argument is passed in

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Oct 31, 2023
@alanjhughes alanjhughes marked this pull request as ready for review October 31, 2023 08:47
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Oct 31, 2023
@alanjhughes alanjhughes merged commit 44c5052 into main Oct 31, 2023
6 of 7 checks passed
@alanjhughes alanjhughes deleted the @alanhughes/fonts/empty-options branch October 31, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants