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
459 stars 8 forks source link

hooks error in nativescript 8.8.1 #31

Closed wjchoi87 closed 1 month ago

wjchoi87 commented 4 months 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 4 months ago

+1

vallemar commented 3 months ago

same error here

matteo6b commented 3 months ago

In nativescript 8.8.2 same here

NathanWalker commented 3 months 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"