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.

React native release error

See original GitHub issue

I’ve started using urql on a react-native project, that’s implemented with Amplify… All went pretty smooth, we have the types and hooks generated automatically, didn’t ran into any major issues

However, when we create a release version of the app, we have these really weird errors (runs perfectly fine in debug mode) on iOS

I am going crazy over this and have tried different variations, different exchange version, but still failing. While I know that this information might be scarce it would be really helpful if you could maybe point me in the right direction for tracking this behaviour.

I’ve added the generated queries here https://gist.github.com/cipriancaba/1f543a10f3c53024746e70e51ba875d8

Much appreciated and thanks for the amazing work on the project

On the older version of urql this was the error:

error][tid:com.facebook.react.JavaScript] RangeError: Maximum call stack size exceeded.

This error is located at:
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in RNCSafeAreaView
    in Unknown
    in Unknown
    in Unknown
    in RCTView
    in A
    in Unknown
    in RCTView
    in RCTView
    in x

On the latest version it’s this

[error][tid:com.facebook.react.JavaScript] TypeError: s is not a function. (In 's(wonka.filter(_ref2)(f))', 's' is undefined)

This error is located at:
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in RNCSafeAreaView
    in Unknown
    in Unknown
    in Unknown
    in RCTView
    in A
    in b
    in RCTView
    in RCTView
    in x

urql version & exchanges:

"@urql/exchange-graphcache": "^2.4.2",
"@urql/exchange-persisted-fetch": "^1.0.0",
"@urql/exchange-retry": "^0.1.7",
"urql": "^1.9.7",
const client = React.useMemo(
    () =>
      createClient({
        url: awsconfig.aws_appsync_graphqlEndpoint,
        fetchOptions: () => {
          // console.log('Fetching options with access token', auth.accessToken)
          return {
            headers: {
              authorization: auth.accessToken || '',
            },
          }
        },
        exchanges: [
          devtoolsExchange,
          dedupExchange,
          cacheExchange({
            keys: {
              GoalsProgress: () => null,
              GoalMaxValue: () => null,
              GoalMinValue: () => null,
              GoalMinMaxValue: () => null,
              GoalPercentageValue: () => null,
              GoalHydrationResultDetails: () => null,
              GoalHydrationResult: () => null,
              GoalStandingResultDetails: () => null,
              GoalStandingResult: () => null,
              GoalFoodResultDetails: () => null,
              GoalFoodResult: () => null,
              GoalExerciseResultDetails: () => null,
              GoalExerciseResult: () => null,
              GetProgramDetailsByDateResult: () => null,
            },
          }),
          retryExchange({
            initialDelayMs: 1000,
            maxDelayMs: 15000,
            randomDelay: true,
            maxNumberAttempts: 2,
            retryIf: err => !!err?.networkError,
          }),
          persistedFetchExchange,
          fetchExchange,
        ] as Exchange[],
      }),
    [auth.accessToken]
  )

Steps to reproduce

  1. Create a release build in iOS
  2. Use a simple query like the one below:
const [
    userSubscriptionsQuery,
    refetchUserSubscriptions,
  ] = useListUserSubscriptionsByUserQuery({
    variables: {
      userId,
      limit: 1000,
    },
    requestPolicy: 'network-only',
  })

Expected behaviour Query runs fine

Actual behaviour App crashes with limited info due to release optimisations

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
olisticcommented, Jun 1, 2020

@kitten I can confirm wonka@4.0.14 solves the issue for me, thanks!

1reaction
cipriancabacommented, May 24, 2020

I would say so, yes… I removed persistedFetchExchange and seems fine. Thanks for the help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate Release APK with ReactNative CLI (Errors Fixed)
If you face any error/issue when creating the app bundle in steps 1 and 2, most probably due to using the wrong terminal...
Read more >
0.62.1 Release APK: Unable to load script. Make sure you're ...
I tried running with both npx react-native run-android --variant=release and ./gradlew assembleRelease but both of them give the same error.
Read more >
React-native fails to sign release build - Stack Overflow
Hello i recently got this error while running npx react-native run-android --variant=release --no-jetifier. FAILURE: Build failed with an ...
Read more >
Addressing common errors in React Native - LogRocket Blog
Explore common React Native errors such as "command not found" and learn about their causes and potential solutions.
Read more >
Troubleshooting - React Native
If you run into issue where executing npm run android on macOS throws the above error, try to run sudo chmod +x android/gradlew...
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