Bit: On fresh install with react-typescript compiler : Error TS2300 Duplicate identifier

Created on 20 Sep 2020  路  5Comments  路  Source: teambit/bit

Description

With a fresh workspace install, I try to use Bit.dev for the first time. My environement iscreate-react-app + typescript +styled-components + storybook.
When I try to build with [email protected] compiler, I've got bunch of Duplicate identifier errors.

Specifications

  • Bit version: 14.8.8
  • Node version: 13.13.0
  • npm / yarn version: 6.14.4 / 1.22.4
  • Platform: Windows 10
  • Bit compiler (include version): [email protected]
  • Bit tester (include version): none

Context and additional information

image
Part of my Package.json file.

image
errors

arebuild typhelp wanted

Most helpful comment

Same effect/problem in our project.

All 5 comments

Same effect/problem in our project.

Facing same issue

Any update guys? keep getting this error while trying to tag components

It happens because @types/styled-components require @types/react-native and it's causing problems with DOM lib.
Downgrade to version 4.1.8 of @types/styled-components should solve it because it not require @types/react-native:

npm i @types/[email protected] --save-dev --save-exact

I'll soon publish a new version of React-typescript compiler that solve this issue without downgrading the @types/styled-components version, the compiler will remove the @types/react-native from the node_modules folder inside the build process of the component.

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33311
https://stackoverflow.com/questions/54706594/types-styled-components-duplicate-identifier-formdata

I published a new version of the React-typescript compiler to solve this issue:
https://bit.dev/bit/envs/compilers/react-typescript?version=3.1.63

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nuruddinjr picture Nuruddinjr  路  3Comments

lubomir-chatoryiskyi picture lubomir-chatoryiskyi  路  3Comments

kegi picture kegi  路  4Comments

KutnerUri picture KutnerUri  路  4Comments

KutnerBitsrc picture KutnerBitsrc  路  4Comments