OpenNative / open-native

Open Native brings cross-platform communities together to help them collaborate and strengthen each other through development diversity.
https://open-native.org/
MIT License
452 stars 8 forks source link

hooks error in nativescript 8.8.1 #31

Open wjchoi87 opened 1 month ago

wjchoi87 commented 1 month ago

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);
}
mariokehl commented 1 month ago

+1

vallemar commented 1 month ago

same error here

matteo6b commented 3 weeks ago

In nativescript 8.8.2 same here

NathanWalker commented 3 weeks ago

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"