Amplify-js: Duplicate identifier 'Subscriber with typescript

Created on 24 Sep 2018  ยท  3Comments  ยท  Source: aws-amplify/amplify-js

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:

  1. install latest stable aws-amplify and aws-amplify-react
  2. run the application

Desktop (please complete the following information):

  • OS: [Mac OS High Sierra 10.13.6]

    • Chrome webbrowser

Have I missed any @types dependencies perhaps?

BR

TypeScript investigating needs-review

Most helpful comment

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

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings