awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
916 stars 265 forks source link

npm install fails with typescript error #754

Open joshuanapoli opened 9 months ago

joshuanapoli commented 9 months ago

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? bug

What is the current behavior? Running npm install on a fresh clone of this repo fails with a typescript error:

npm ERR! code 2
npm ERR! path /Users/joshnapoli/src/aws-mobile-appsync-sdk-js/packages/aws-appsync-auth-link
npm ERR! command failed
npm ERR! command sh -c -- tsc
npm ERR! ../../node_modules/@types/babel__traverse/index.d.ts(321,9): error TS1110: Type expected.
npm ERR! ../../node_modules/@types/babel__traverse/index.d.ts(321,30): error TS1005: ';' expected.
npm ERR! ../../node_modules/@types/babel__traverse/index.d.ts(321,31): error TS1128: Declaration or statement expected.
npm ERR! ../../node_modules/@types/babel__traverse/index.d.ts(321,51): error TS1005: '(' expected.
npm ERR! ../../node_modules/@types/babel__traverse/index.d.ts(322,1): error TS1128: Declaration or statement expected.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Run the following command:

git clone https://github.com/awslabs/aws-mobile-appsync-sdk-js.git && cd aws-mobile-appsync-sdk-js && npm install

What is the expected behavior?

I expect that npm install runs correctly.

The problem can be fixed by upgrading the typescript dependency.

npm install typescript@^5.2.2

Probably the latest version of a transitive dependency @types/babel__traverse has new typescript syntax not supported by the tsc v3.8.

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?

The problem affects the tip of master, 8502a78.