auth0 / react-native-auth0

React Native toolkit for Auth0 API
https://auth0.com
MIT License
498 stars 209 forks source link

Missing NativeModule after `react-native upgrade`. `v2.13.1` #487

Closed michaelbeutler closed 2 years ago

michaelbeutler commented 2 years ago

Describe the problem

When trying to authenticate, the error Missing NativeModule gets thrown.

What was the expected behavior?

When clicking any button, the user should be authenticated using webauth.

Reproduction

image

Environment

And yes, I tried running pod install...

Widcket commented 2 years ago

Hi @michaelbeutler, thanks for raising this. Are you able to reproduce this using the sample app at https://github.com/auth0-samples/auth0-react-native-sample?

michaelbeutler commented 2 years ago

Thanks for the swift reply, that's awesome. However, I tried to install the auth0-samples/auth0-react-native-sample and got the following error:

Screenshot 2022-06-24 at 18 25 16

I also tried with npm install --force, then however I was unable to run pod install.

☁  00-Login [master] cd ios
☁  ios [master] pod install
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
/Users/michaelbeutler/Documents/repositories/auth0-react-native-sample/00-Login/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:51: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/Users/michaelbeutler/Documents/repositories/auth0-react-native-sample/00-Login/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:51: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "React-RCTLinking":
  In Podfile:
    React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)

Specs satisfying the `React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)` dependency were found, but they required a higher minimum deployment target.

Should I clone a different branch?

Additional Info:

☁  00-Login [master] npm version
{
  Auth0Samples: '0.0.1',
  npm: '8.13.1',
  node: '17.8.0',
  v8: '9.6.180.15-node.16',
  uv: '1.44.1',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '102',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '1.1.1n',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0'
}

Thanks in advance.

Widcket commented 2 years ago

Hi, I just tried installing the dependencies from scratch (on master) using both yarn and npm and was successful:

Screen Shot 2022-06-24 at 13 53 16
michaelbeutler commented 2 years ago

Okay, I tried again and it yarn install worked. But pod install still produces the following error:

☁  ios [master] pod install
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
/Users/michaelbeutler/Documents/repositories/auth0-react-native-sample/00-Login/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:51: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/Users/michaelbeutler/Documents/repositories/auth0-react-native-sample/00-Login/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:51: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "React-RCTLinking":
  In Podfile:
    React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)

Specs satisfying the `React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)` dependency were found, but they required a higher minimum deployment target.
Widcket commented 2 years ago

Just installed the pods from scratch and was successful:

Screen Shot 2022-06-24 at 14 35 21

Do you have your specs repo clone updated? Run pod repo update if not.

michaelbeutler commented 2 years ago

I did... do you use an arm64?

Widcket commented 2 years ago

No, I'm not using an M1.

michaelbeutler commented 2 years ago

Okay, I will try with a different machine.

michaelbeutler commented 2 years ago

Okay, it was my fault, had to simply remove node_modules and yarn.lock and install everything again. Works now, thanks for the quick support.

dminkovsky commented 2 years ago

This is still broken, I think. Please see my repro at https://github.com/auth0-samples/auth0-react-native-sample/issues/68.

To address this issue, https://github.com/auth0/react-native-auth0/issues/487#issuecomment-1165769344, see this PR: https://github.com/auth0-samples/auth0-react-native-sample/pull/66

mikebrsv commented 2 years ago

@michaelbeutler Hi, were you able to install npm dependencies on arm64?

michaelbeutler commented 2 years ago

@michaelbeutler Hi, were you able to install npm dependencies on arm64?

Yes, it worked by reinstalling all dependencies.