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
wodin
September 24, 2019, 7:35am
#2
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:
) {
// Add google services file if it exists
await _resolveGoogleServicesFile(projectRoot, exp);
// Convert asset patterns to a list of asset strings that match them.
// Assets strings are formatted as `asset_<hash>.<type>` and represent
// the name that the file will have in the app bundle. The `asset_` prefix is
// needed because android doesn't support assets that start with numbers.
if (exp.assetBundlePatterns) {
const fullPatterns: string[] = exp.assetBundlePatterns.map((p: string) =>
path.join(projectRoot, p)
);
logger.global.info('Processing asset bundle patterns:');
fullPatterns.forEach(p => logger.global.info('- ' + p));
// The assets returned by the RN packager has duplicates so make sure we
// only bundle each once.
const bundledAssets = new Set();
for (const asset of assets) {
const file = asset.files && asset.files[0];
const shouldBundle =
'__packager_asset' in asset &&
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
system
closed
October 14, 2019, 8:06am
#5
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.