React-native Expo prebuild failing. Error: ” The “paths[1]” argument must be of type string. Received an instance of Object”

After developing most of my app with react-native on expo, I’ve been trying to build it to check if it works by itself, but when prebuilding I’m running into this particular issue:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:UsersspippolatorReactmyApp> npx expo prebuild
(node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Created native directory | reusing /android
√ Updated package.json | no changes
× Prebuild failed
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
at Object.resolve (node:path:171:9)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45
at Array.map (<anonymous>)
at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29)
at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27)
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14)
at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js
</code>
<code>C:UsersspippolatorReactmyApp> npx expo prebuild (node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) √ Created native directory | reusing /android √ Updated package.json | no changes × Prebuild failed TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object at Object.resolve (node:path:171:9) at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45 at Array.map (<anonymous>) at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28) at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70 at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29) at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27) at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14) at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js </code>
C:UsersspippolatorReactmyApp> npx expo prebuild
(node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Created native directory | reusing /android
√ Updated package.json | no changes
× Prebuild failed
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
    at Object.resolve (node:path:171:9)
    at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45
    at Array.map (<anonymous>)
    at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28)
    at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70
    at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29)
    at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27)
    at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14)
    at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js

I think it’s probably related to how I manage fonts, but I’ve been looking at the documentation and I dont see the problem
But given that I’m new to this framework I’m sure I’m missing something

This is how I manage fonts:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> const [fontsLoaded] = useFonts({
'font1': require('./assets/fonts/firstfont.otf'),
'font2': require('./assets/fonts/secondfont.ttf'),
'font3': require('./assets/fonts/thirdfont.ttf'),
'font4': require('./assets/fonts/fourthfont.otf'),
'font5': require('./assets/fonts/fifthfont.ttf'),
});
</code>
<code> const [fontsLoaded] = useFonts({ 'font1': require('./assets/fonts/firstfont.otf'), 'font2': require('./assets/fonts/secondfont.ttf'), 'font3': require('./assets/fonts/thirdfont.ttf'), 'font4': require('./assets/fonts/fourthfont.otf'), 'font5': require('./assets/fonts/fifthfont.ttf'), }); </code>
  const [fontsLoaded] = useFonts({
    'font1': require('./assets/fonts/firstfont.otf'),
    'font2': require('./assets/fonts/secondfont.ttf'),
    'font3': require('./assets/fonts/thirdfont.ttf'),
    'font4': require('./assets/fonts/fourthfont.otf'),
    'font5': require('./assets/fonts/fifthfont.ttf'),
  });

I then declared variables so that I can reference these fonts throughout the code more easily.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>const titleFont = 'font1';
const headerFont = 'font1';
</code>
<code>const titleFont = 'font1'; const headerFont = 'font1'; </code>
const titleFont = 'font1';
const headerFont = 'font1';

I tried also loading fonts by:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import font1 from './assets/fonts/firstfont.otf';
import font2 from './assets/fonts/secondfont.ttf';
import font3 from './assets/fonts/thirdfont.ttf';
import font4 from './assets/fonts/fourthfont.otf';
import font5 from './assets/fonts/fifthfont.ttf';
//and later
const [fontsLoaded] = useFonts({
'font1': font1,
'font2': font2,
'font3': font3,
'font4': font4,
'font5': font5,
});
</code>
<code>import font1 from './assets/fonts/firstfont.otf'; import font2 from './assets/fonts/secondfont.ttf'; import font3 from './assets/fonts/thirdfont.ttf'; import font4 from './assets/fonts/fourthfont.otf'; import font5 from './assets/fonts/fifthfont.ttf'; //and later const [fontsLoaded] = useFonts({ 'font1': font1, 'font2': font2, 'font3': font3, 'font4': font4, 'font5': font5, }); </code>
import font1 from './assets/fonts/firstfont.otf';
import font2 from './assets/fonts/secondfont.ttf';
import font3 from './assets/fonts/thirdfont.ttf';
import font4 from './assets/fonts/fourthfont.otf';
import font5 from './assets/fonts/fifthfont.ttf';

//and later

  const [fontsLoaded] = useFonts({
    'font1': font1,
    'font2': font2,
    'font3': font3,
    'font4': font4,
    'font5': font5,
  });

but it doesn’t change at all
And this is my app.json:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>{
"expo": {
"name": "myApp",
"slug": "myApp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.spippolator.myApp",
"fonts": {
"font1": "'./assets/fonts/fifthfont.ttf'",
"font2": "./assets/fonts/secondfont.ttf",
"font3": "./assets/fonts/thirdfont.otf",
"font4": "./assets/fonts/fourthfont.ttf",
"font5": "./assets/fonts/fifthfont.ttf"
}
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-build-properties",
{
"android": {
"usesCleartextTraffic": true
}
}
],
[
"expo-font",
{
"fonts": [
{
"fonts": "./assets/fonts/larabiefont-free.rg-regular.otf"
},
{
"fonts": "./assets/fonts/SvBasicManual-nRPP.ttf"
},
{
"fonts": "./assets/fonts/hackerchaos.otf"
},
{
"fonts": "./assets/fonts/Hacked-KerX.ttf"
},
{
"fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf"
}
]
}
]
],
"extra": {
"eas": {
"projectId": "987944a8-f07f-4599-857e-8734584802e4"
}
}
}
}
</code>
<code>{ "expo": { "name": "myApp", "slug": "myApp", "version": "1.0.0", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", "splash": { "image": "./assets/splash.png", "resizeMode": "contain", "backgroundColor": "#ffffff" }, "assetBundlePatterns": [ "**/*" ], "ios": { "supportsTablet": true }, "android": { "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", "backgroundColor": "#ffffff" }, "package": "com.spippolator.myApp", "fonts": { "font1": "'./assets/fonts/fifthfont.ttf'", "font2": "./assets/fonts/secondfont.ttf", "font3": "./assets/fonts/thirdfont.otf", "font4": "./assets/fonts/fourthfont.ttf", "font5": "./assets/fonts/fifthfont.ttf" } }, "web": { "favicon": "./assets/favicon.png" }, "plugins": [ [ "expo-build-properties", { "android": { "usesCleartextTraffic": true } } ], [ "expo-font", { "fonts": [ { "fonts": "./assets/fonts/larabiefont-free.rg-regular.otf" }, { "fonts": "./assets/fonts/SvBasicManual-nRPP.ttf" }, { "fonts": "./assets/fonts/hackerchaos.otf" }, { "fonts": "./assets/fonts/Hacked-KerX.ttf" }, { "fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf" } ] } ] ], "extra": { "eas": { "projectId": "987944a8-f07f-4599-857e-8734584802e4" } } } } </code>
{
  "expo": {
    "name": "myApp",
    "slug": "myApp",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.spippolator.myApp",
      "fonts": {
        "font1": "'./assets/fonts/fifthfont.ttf'",
        "font2": "./assets/fonts/secondfont.ttf",
        "font3": "./assets/fonts/thirdfont.otf",
        "font4": "./assets/fonts/fourthfont.ttf",
        "font5": "./assets/fonts/fifthfont.ttf"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "usesCleartextTraffic": true
          }
        }
      ],
      [
        "expo-font",
        {
          "fonts": [
            { 
              "fonts": "./assets/fonts/larabiefont-free.rg-regular.otf"
            },
            {
              "fonts": "./assets/fonts/SvBasicManual-nRPP.ttf"
            },
            {
              "fonts": "./assets/fonts/hackerchaos.otf"
            },
            {
              "fonts": "./assets/fonts/Hacked-KerX.ttf"
            },
            {
              "fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf"
            }
          ]
        }
      ]
    ],
    "extra": {
      "eas": {
        "projectId": "987944a8-f07f-4599-857e-8734584802e4"
      }
    }
  }
}

When I start my build it also says as a warning that: ”
I’m having a really hard time figuring this out, can anyone help me?
Thank you!

Tried changing fonts path, how I declare fonts, updating expo and some other stuff.
Also tried modifying app.json
Tried building a whole new project, still doesn’t work.

New contributor

Nicola is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật