callstack / repack

A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem.
https://re-pack.dev
MIT License
1.43k stars 103 forks source link

aws-appsync issue #653

Closed durkumar closed 2 months ago

durkumar commented 2 months ago

I am integrated aws-appsync in repack (react native) and its working fine in debug mode but when try create release apk its showing issue

Execution failed for task ':app:createBundleReleaseJsAndAssets'.

But when i comment out "createAuthLink()" apk genration successful

createAuthLink({ url, region, auth }),

can any one help out ?

jbroma commented 2 months ago

Hi @durkumar,

can you share some more details about the error you're getting during the build? Please also state what version of Re.Pack you are using when this happens.

durkumar commented 2 months ago

Hi @durkumar,

can you share some more details about the error you're getting during the build? Please also state what version of Re.Pack you are using when this happens.

I am sharing my code details Re.pack version :- pnpm@9.1.4

import { AuthOptions, createAuthLink } from "aws-appsync-auth-link"; import { createSubscriptionHandshakeLink } from "aws-appsync-subscription-link"; import { ApolloClient, InMemoryCache, HttpLink, ApolloLink, } from "@apollo/client"; const url = 'https://test.com'; const region = 'ap-southeast-1';

const auth:AuthOptions = { type: 'AMAZON_COGNITO_USER_POOLS', jwtToken: async () => { let token = await AsyncStorage.getItem('token') return token } };

const httpLink = new HttpLink({ uri: url }); const link = ApolloLink.from([ createAuthLink({ url, region, auth }), createSubscriptionHandshakeLink({ url, region, auth }, httpLink), ]);

const client = new ApolloClient({ link, cache: new InMemoryCache(), defaultOptions: { mutate: { errorPolicy: 'ignore' }, }, });

jbroma commented 2 months ago

I was asking about the error message during the build of Android as there must be some kind of error happening in the logs when it fails the whole release build

Please also check the Re.Pack version - you've provided is the version of pnpm in the message above.

durkumar commented 2 months ago

Re.Pac

error -

/@callstack/repack@3.4.0

jbroma commented 2 months ago

I'm not able to assist you with the information you've provided so far - please create a minimal reproduction repository where the bug is happening (please try to avoid recreating your whole project since I will simply not have enough time to investigate it properly).

You can also try upgrading Re.Pack to the newest version to see if it fixes the issues

jbroma commented 2 months ago

I'm closing this one since not enough information has been provided to diagnose this issues - please create a new issue with a repro to investigate this further, thanks!