react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.12k stars 877 forks source link

missing dependencies #1241

Closed ionflow closed 4 months ago

ionflow commented 5 months ago

Hello, new sponsor here. I'm getting the following issues when following the new guide.

Building a simulator version for iOS using EAS works (doesn't fail), but when I try to then run it on the iOS simulator in Expo Go (v50.0.4) I get the following errors:

› Opening on iOS...
› Opening exp+my-app://expo-development-client/?url=http%3A%2F%2F192.168.7.41%3A8081 on iPhone 15 Pro
› Press ? │ show all commands
iOS Bundling failed 1563ms (node_modules/expo/AppEntry.js)
error: node_modules/@react-native-google-signin/google-signin/src/index.ts: Cannot find module '@react-native-google-signin/babel-plugin-google-signin'
Require stack:
- /Users/username/Sites/my-app/node_modules/@babel/core/lib/config/files/plugins.js
- /Users/username/Sites/my-app/node_modules/@babel/core/lib/config/files/index.js
- /Users/username/Sites/my-app/node_modules/@babel/core/lib/index.js
- /Users/username/Sites/my-app/node_modules/metro-transform-worker/src/index.js
- /Users/username/Sites/my-app/node_modules/@expo/metro-config/build/transform-worker/metro-transform-worker.js
- /Users/username/Sites/my-app/node_modules/@expo/metro-config/build/transform-worker/transform-worker.js
- /Users/username/Sites/my-app/node_modules/metro/src/DeltaBundler/Worker.flow.js
- /Users/username/Sites/my-app/node_modules/metro/src/DeltaBundler/Worker.js
- /Users/username/Sites/my-app/node_modules/jest-worker/build/workers/processChild.js
- If you want to resolve "@react-native-google-signin/google-signin", use "module:@react-native-google-signin/google-signin"

Make sure that all the Babel plugins and presets you are using
are defined as dependencies or devDependencies in your package.json
file. It's possible that the missing plugin is loaded by a preset
you are using that forgot to add the plugin to its dependencies: you
can workaround this problem by explicitly adding the missing package
to your top-level package.json.

Then following these suggestions and installing the "@react-native-google-signing/babel-plugin-google-signin" results in this error:

56 error 404 Not Found - GET https://npm.pkg.github.com/@react-native-google-signin%2fbabel-plugin-google-signin - npm package "babel-plugin-google-signin" does not exist under owner "react-native-google-signin"
57 error 404
58 error 404  '@react-native-google-signin/babel-plugin-google-signin@*' is not in this registry.

My babel.config.js looks like this:

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ["babel-preset-expo"],
    plugins: [
      ["react-native-reanimated/plugin"],
      ["react-native-worklets-core/plugin"],
      [
        "@react-native-google-signin/google-signin",
        {
          iosUrlScheme:
            "com.googleusercontent.apps.myclientid",
        },
      ],
    ],
  };
};
vonovak commented 5 months ago

Hello and thanks for asking, You have placed the configuration into a wrong file (babel.config.js). It needs to live in app config: https://docs.expo.dev/workflow/configuration/

Thank you for your support 🙂

vonovak commented 5 months ago

Also please note that the package won't work in expo go, as documented here https://react-native-google-signin.github.io/docs/setting-up/expo