question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[expo-auth-session] Get error when launching the remote debug (Calling synchronous methods ...)

See original GitHub issue

Summary

When I want to use the expo-auth-session module I always get the following error when I enable the remote debugger:

Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome. Consider providing alternative methods to expose this method in debug mode, e.g. by exposing constants ahead-of-time.

Simulator Screen Shot - iPhone 12 - 2021-06-17 at 12 11 47 Simulator Screen Shot - iPhone 12 - 2021-06-17 at 12 11 55

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android, iOS

SDK Version (managed workflow only)

~41.0.1

Environment

Expo CLI 4.5.2 environment info: System: OS: macOS 12.0 Shell: 5.8 - /bin/zsh Binaries: Node: 15.9.0 - /usr/local/bin/node npm: 7.7.6 - /usr/local/bin/npm Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 IDEs: Android Studio: 4.2 AI-202.7660.26.42.7351085 Xcode: 12.5/12E262 - /usr/bin/xcodebuild npmPackages: expo: ~41.0.1 => 41.0.1 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: expo-cli: 4.5.2 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

insert this code crash the app with remote debug enabled:

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import * as Google from "expo-auth-session/providers/google";
import * as WebBrowser from "expo-web-browser";
WebBrowser.maybeCompleteAuthSession();

export default function App() {
  const [request, response, promptAsync] = Google.useAuthRequest({
    expoClientId:"GOOGLE_GUID.apps.googleusercontent.com",
    iosClientId: "GOOGLE_GUID.apps.googleusercontent.com",
    androidClientId: "GOOGLE_GUID.apps.googleusercontent.com",
    webClientId: "GOOGLE_GUID.apps.googleusercontent.com",
  });

  return (
    <View style={styles.container}>
      <Text>Open up App.tsx to start working on your app!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
});```

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brentvatnecommented, Jan 12, 2022

expo install gives you the version of the package that is compatible with the expo sdk version that you are using. if you need to use a more recent version, consider upgrading the sdk version

1reaction
odama626commented, Sep 23, 2021

looks like this is related https://github.com/expo/expo/issues/12712 looks like a fix was recently merged as well for it, just waiting for a newer version of expo-random https://github.com/expo/expo/pull/13616

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calling synchronous methods on native modules is not ...
Expo useAuthRequest with devTools remote debugging throws error: Calling synchronous methods on native modules is not supported in Chrome.
Read more >
Cannot debug in chrome - Issues developing apps - OpenVidu
when turn on debug mode chrome , get this error and don't published me : Invariant Violation: Calling synchronous methods on native modules ......
Read more >
Debugging - Expo Documentation
Learn about different techniques and tools available to debug your Expo project. ... tracking down the source of an error gets exponentially easier....
Read more >
Troubleshooting common PHP debugging issues | PhpStorm ...
In some cases, the debugger can connect, but you get the error messages indicating that no mapping between the remote and project files...
Read more >
Debug Browser Apps using Visual Studio Code
Browser debugging in VS Code. Visual Studio Code includes a built-in debugger for Edge and Chrome. There are a couple ways to get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found