React native release error
See original GitHub issueI’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
- Create a release build in iOS
- 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:
- Created 3 years ago
- Comments:12 (7 by maintainers)
@kitten I can confirm
wonka@4.0.14
solves the issue for me, thanks!I would say so, yes… I removed persistedFetchExchange and seems fine. Thanks for the help