Expo publish error of Received type object

When I run expo publish I am getting an error
The “path” argument must be of type string. Received type object
TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received type object
at assertPath (path.js:39:11)
at Object.join (path.js:1152:7)
at exp.assetBundlePatterns.map.p (/@expo/xdl@56.2.2/src/Project.ts:1158:12)
at Array.map ()
at _configureExpForAssets (/@expo/xdl@56.2.2/src/Project.ts:1157:60)
at process._tickCallback (internal/process/next_tick.js:68:7)

and the process terminates.

Following is the output of expo diagnostics

Expo CLI 3.1.0 environment info:
System:
OS: macOS 10.14.3
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5264788
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
expo: ^34.0.1 => 34.0.4
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8
npmGlobalPackages:
expo-cli: 3.1.0

What does your app.json contain for the assetBundlePatterns? It should be an array of strings. The error seems to be saying that yours is not.

e.g.

    "assetBundlePatterns": [                                                                                                                                                                                
      "assets/*"                                                                                                                                                                                            
    ],                                                                                                                                                                                                      

Here’s the code that’s failing:

Here is my app.json

{
  "expo": {
    "name": "DemoApp",
    "slug": "demoApp",
    "privacy": "public",
    "sdkVersion": "34.0.0",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      ["assets/*"]
    ],
    "android": {
      "package": "com.demoapp",
      "config": {
          "googleMaps": {
          "apiKey": "MAP_API_KEY"
        }
      }
    },
    "ios": {
      "bundleIdentifier": "com.demoapp",
      "supportsTablet": true,
      "config": {
        "googleMapsApiKey": "MAP_API_KEY"
      }
    }
  }
}

I have changed to
“assetBundlePatterns”: [
“assets/*”
]

now it is working properly.

Thank You

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.