aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

Missing dependencies in aws-appsync-auth-link package?

Open SverrirV opened this issue 3 years ago • 1 comments

Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the official AWS AppSync forum

Do you want to request a feature or report a bug? Reporting a potential bug

What is the current behavior? Buffer is not found when using aws-appsync-auth-link pacakge with React Native.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. include the aws-appsync-auth-link package to a react-native project. Use it to implement Apollo v3 with Appsync.

What is the expected behavior? Buffer package to be included in the aws-appsync-auth-link pacakge dependencies

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? React-Native: 0.66 aws-appsync-auth-link: 3.0.7

I was following the instructions on how to create an Appsync link for Apollo v3 and I notice that the signer.ts has this line at the top.

global.Buffer = global.Buffer || require('buffer').Buffer; // Required for aws sigv4 signing

require("buffer") will fail unless you manually install the buffer package your self since it is not included in the aws-appsync-auth-link dependencies.

Was not sure if I should create a issue for this but feel that if signer.ts file tries to require it, it should be included in the dependencies.

SverrirV avatar Nov 17 '21 11:11 SverrirV

I am using yarn with pnp. For me the issue was resolved by declaring the missing dependencies.

.yarnrc.yml

yarnPath: .yarn/releases/yarn-3.2.1.cjs
packageExtensions:
  aws-appsync-subscription-link@*:
    dependencies:
      uuid: "*"
  aws-appsync-auth-link@*:
    dependencies:
      url: "*"
      buffer: "*"

butterybread avatar Jul 27 '22 13:07 butterybread