open-native icon indicating copy to clipboard operation
open-native copied to clipboard

hooks error in nativescript 8.8.1

Open wjchoi87 opened this issue 1 year ago • 4 comments

After updating to nativescript 8.8.1, I was getting the error below when building.

[@open-native/core/hooks/before-prepare.js] Autolinking React Native ios native modules...
TypeError: (0 , glob_1.glob)(...).then is not a function
    at /Users/wjchoi/workspace/mobile/centumpay/ns8_customer/node_modules/@open-native/core/hooks/ios/common.js:26:44
    at new Promise (<anonymous>)
    at globProm (/Users/wjchoi/workspace/mobile/centumpay/ns8_customer/node_modules/@open-native/core/hooks/ios/common.js:25:12)
    at getPackageAutolinkInfo (/Users/wjchoi/workspace/mobile/centumpay/ns8_customer/node_modules/@open-native/core/hooks/ios/getters/autolink-info.js:19:50)
    at /Users/wjchoi/workspace/mobile/centumpay/ns8_customer/node_modules/@open-native/core/hooks/ios/prepare.js:14:125
    at Array.map (<anonymous>)
    at autolinkIos (/Users/wjchoi/workspace/mobile/centumpay/ns8_customer/node_modules/@open-native/core/hooks/ios/prepare.js:14:61)
    at async module.exports (/Users/wjchoi/workspace/mobile/centumpay/ns8_customer/node_modules/@open-native/core/hooks/before-prepare.js:73:24)
(0 , glob_1.glob)(...).then is not a function

I did the following temporarily.

Add in the @open-native/core/hooks/ios/common.js file

const { promisify } = require('util');
const globPromise = promisify(glob_1);

Change function

function globProm(pattern, options) {
  return globPromise(pattern, options);
}

wjchoi87 avatar Jul 23 '24 08:07 wjchoi87

+1

mariokehl avatar Jul 26 '24 10:07 mariokehl

same error here

vallemar avatar Jul 31 '24 07:07 vallemar

In nativescript 8.8.2 same here

matteo6b avatar Aug 25 '24 14:08 matteo6b

Hi @wjchoi87 @vallemar @matteo6b @mariokehl this is most likely related to your project dependencies pulling in different glob versions. You can setup "overrides" or "resolutions" in your project's package.json to specify this version (and also add this dependency explicitly to your package.json):

"glob": "^10.0.0"

NathanWalker avatar Aug 26 '24 16:08 NathanWalker