1

I am using Magento 2.3.6 and have installed Amazon Sales Channel 4.4.0, I have added the Production API Key and Production Private Key under Magento Services but I get this error "Unexpected network error", can anyone explain what causes this error?

enter image description here

Click Add Amazon Store and I get this error:

enter image description here

Browser Console: GRAPHQL ERROR: Error: GraphQL error: Internal server error https://cdn.amazon.channels.magento.com/4.4.0/static/js/components/HelperFunctions/GQLErrorHandler.tsx

import { ApolloError } from 'apollo-client';

interface MagentoNetworkError {
  name: string;
  response: {};
  statusCode: number;
  result: {
    ajaxExpired: number;
    ajaxRedirect: string;
  };
}

/* 
 If Magento is open in 2+ tabs, and the user signs out in one of them, all
 the other sessions will also be terminated. All GQL queries & mutations will
 return a Network Error that follow the pattern in the interface above. 
 
 If that's the case, display a toast
 that will not go way. If it's any other error, then just display whatever 
 custom message was passed in. 
 */

export const GQLErrorHandler = (error: ApolloError | undefined, message?: string) => {
  let networkError = (error?.networkError as unknown) as MagentoNetworkError;

  if (process.env.NODE_ENV !== 'production') {
    console.error(error);
  }

  if (
    networkError &&
    networkError.result &&
    networkError.result.ajaxExpired &&
    networkError.result.ajaxRedirect
  ) {
    errorToast(`Your session has timed out.`, {
      actionLabel: 'Sign in',
      onAction: () => {
        window.location.replace(networkError.result.ajaxRedirect);
      },
      timeout: 0,
    });
  } else if (error) {
    let errorMessage = message ?? 'Unexpected network error, please try again later.';
    errorToast(errorMessage);
  }
  console.error('GRAPHQL ERROR: \n ' + error);
};
4
  • Did you got any soulution
    – Sabareesh
    Commented Aug 30, 2021 at 13:33
  • Iam using the Magento Commerce but for me i can't see magento services options
    – Sabareesh
    Commented Aug 30, 2021 at 13:35
  • Getting exact same error in Magento open source version 2.4.1 and installed version of Amazon please channel is 4.4.1. Can anyone have any solution for this? Commented Oct 21, 2021 at 7:41
  • same... Magento 2.4.6. Module_Amazon is 4.5.0
    – Jon
    Commented Feb 6 at 22:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.