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

Plugin is an unexpected type: object #54

Closed
kisonay opened this issue Jan 28, 2022 · 9 comments
Closed

Plugin is an unexpected type: object #54

kisonay opened this issue Jan 28, 2022 · 9 comments

Comments

@kisonay
Copy link

kisonay commented Jan 28, 2022

Trying to follow the directions and receive the following error when modifying the plugin array:

"plugins": [
      "onesignal-expo-plugin",
      {
        "mode": "development",
      }
    ]

Error:

Plugin is an unexpected type: object

If I remove the object, then I receive the following error:

Missing required "mode" key in your app.json or app.config.js file for "onesignal-expo-plugin".

Package dependencies:

"dependencies": {
    "expo": "~44.0.0",
    "expo-status-bar": "~1.2.0",
    "onesignal-expo-plugin": "^1.0.0-beta10",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-web": "0.17.1",
    "expo-splash-screen": "~0.14.1"
  },
@rgomezp
Copy link
Contributor

rgomezp commented Jan 28, 2022

Howdy,
You're missing an extra set of brackets. Check the README again for reference.

Enjoy!

@rgomezp rgomezp closed this as completed Jan 28, 2022
@kisonay
Copy link
Author

kisonay commented Jan 28, 2022

Doh, now I feel foolish. Cant tell you how many times I compared it to the docs...

@m5atib
Copy link

m5atib commented May 14, 2023

This message often appears when there is an error in the app.json file

@DeliveranceTechSolutions

I second @m5atib my problem was the app.json with something random in it.

@nazirahmad7340
Copy link

nazirahmad7340 commented Sep 29, 2023

"plugins": [
    [
          "onesignal-expo-plugin",
          {
            "mode": "development",
          }
    ]
 ]
you have a missing []
This is the correct syntax

@devnshankar
Copy link

devnshankar commented Dec 2, 2023

"plugins": [[
    "expo-router",
    "expo-image-picker",
    {
      "photosPermission": "The app accesses your photos to let you share them with your friends."
    }]]

The error when double square brackets are imlpimented as guided in the docs

AssertionError [ERR_ASSERTION]: Wrong number of arguments provided for static config plugin, expected either 1 or 2, got 3

I've been scratching my head since 5 minutes still no solution.

@SaeedSoheili
Copy link

"plugins": [[
    "expo-router",
    "expo-image-picker",
    {
      "photosPermission": "The app accesses your photos to let you share them with your friends."
    }]]

The error when double square brackets are imlpimented as guided in the docs

AssertionError [ERR_ASSERTION]: Wrong number of arguments provided for static config plugin, expected either 1 or 2, got 3

I've been scratching my head since 5 minutes still no solution.

i think correct solution is like:

    "plugins": [
      "@react-native-google-signin/google-signin",
      [
        "expo-build-properties",
        {
          "android": {
            "usesCleartextTraffic": true
          }
        }
      ]
    ],

@princechibez
Copy link

"plugins": [ "expo-router", "expo-font", { "fonts": [ "./assets/fonts/Rubik-Regular.ttf" ] } ],

I tried adding expo font to the plugin and it keeps returning an error
PluginError: Plugin is an unexpected type: object

@hasanzu514
Copy link

"plugins": [ "expo-router", "expo-font", { "fonts": [ "./assets/fonts/Rubik-Regular.ttf" ] } ],

I tried adding expo font to the plugin and it keeps returning an error PluginError: Plugin is an unexpected type: object

I had the same error but looking at the above replies I did the following (wrapped all the expo font part in brakcets):
"plugins": [ "expo-router", ["expo-font", { "fonts": [ "./assets/fonts/Rubik-Regular.ttf" ] } ]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants