Describe the bug
Getting the error:
"Duplicate identifier Subscriber" when trying to run my react application with typescript.
The error seems to be located in:
my_project/node_modules/@aws-amplify/api/node_modules/@types/zen-observable/index.d.ts
My dependencies:
"react": "^16.4.1",
"aws-amplify": "1.1.3",
"aws-amplify-react": "^2.0.4",
"typescript": "2.8.3"
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Have I missed any @types dependencies perhaps?
BR
Can confirm this still occurs in 1.1.5 with an angular application
Edit: For me my workaround for my ionic / angular project was to use yarn instead of npm. I deleted all node modules and reinstalled with yarn. That solved the issue, but I'd like to use npm since yarn isn't officially supported by angular.
I am also seeing the issue except with a React application and using yarn:
aws-amplify: 1.1.10
aws-appsync: 1.7.0
typescript: 3.1.6
The issue arose when I added aws-appsync
to my project.
This is the error: node_modules/@aws-amplify/api/node_modules/@types/zen-observable/index.d.ts
(32,14): Duplicate identifier 'Subscriber'.
And when I run npm ls @types/zen-observable
, these are the results:
[email protected]
โ โโโ @types/[email protected]
โโโฌ [email protected]
โ โโโฌ @aws-amplify/[email protected]
โ โ โโโ @types/[email protected]
โ โโโฌ @aws-amplify/[email protected]
โ โโโ @types/[email protected]
โโโฌ [email protected]
โโโฌ [email protected]
โ โโโ @types/[email protected] deduped
โโโฌ [email protected]
โโโ @types/[email protected] deduped
FYI.. My fix for the time being is to exclude node_modules
in my tsconfig.json
file. You also need to set skipLibCheck
to true
Most helpful comment
FYI.. My fix for the time being is to exclude
node_modules
in mytsconfig.json
file. You also need to setskipLibCheck
totrue