question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type conflict using preact@^10.5.7 + preact-i18n@2.3.0-preactx + @types/preact-i18n@^1.2.0

See original GitHub issue

the compilation works, and the page is displayed, but in the console there are tons of errors, such as:

ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(942,13):
TS2320: Interface 'Element' cannot simultaneously extend types 'VNode<any>' and 'ReactElement<any, any>'.
  Named property 'key' of types 'VNode<any>' and 'ReactElement<any, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(945,13):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, any>' and 'Component<any, {}, any>'.
  Named property 'componentDidUpdate' of types 'Component<any, any>' and 'Component<any, {}, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(945,13):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, any>' and 'Component<any, {}, any>'.
  Named property 'componentWillUpdate' of types 'Component<any, any>' and 'Component<any, {}, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(945,13):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, any>' and 'Component<any, {}, any>'.
  Named property 'props' of types 'Component<any, any>' and 'Component<any, {}, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(945,13):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, any>' and 'Component<any, {}, any>'.
  Named property 'setState' of types 'Component<any, any>' and 'Component<any, {}, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(945,13):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, any>' and 'Component<any, {}, any>'.
  Named property 'shouldComponentUpdate' of types 'Component<any, any>' and 'Component<any, {}, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(945,13):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, any>' and 'Component<any, {}, any>'.
  Named property 'state' of types 'Component<any, any>' and 'Component<any, {}, any>' are not identical.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/preact-i18n/node_modules/preact/dist/preact.d.ts(956,8):
TS2300: Duplicate identifier 'LibraryManagedAttributes'.
  ·
  ·
  ·
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/react/index.d.ts(3164,13):
TS2717: Subsequent property declarations must have the same type.  Property 'symbol' must be of type 'SVGAttributes', but here has type 'SVGProps<SVGSymbolElement>'.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/react/index.d.ts(3165,13):
TS2717: Subsequent property declarations must have the same type.  Property 'text' must be of type 'SVGAttributes', but here has type 'SVGProps<SVGTextElement>'.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/react/index.d.ts(3167,13):
TS2717: Subsequent property declarations must have the same type.  Property 'tspan' must be of type 'SVGAttributes', but here has type 'SVGProps<SVGTSpanElement>'.
ERROR in /home/user/Projects/drackp2m/esp3d-ui/node_modules/@types/react/index.d.ts(3168,13):
TS2717: Subsequent property declarations must have the same type.  Property 'use' must be of type 'SVGAttributes', but here has type 'SVGProps<SVGUseElement>'.

When I remove the type package, the compilation does not fail, but the imports are not done automatically.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
drackp2mcommented, Dec 8, 2020

Finally the pull request of @saschazar21 are merged and the issue has been fixed!

❤️

1reaction
drackp2mcommented, Dec 7, 2020

Unfortunately I don’t have much time to review all that, I finally hid the errors by adding skipLibCheck => true in the compilerOptions section of my tsconfig.json file.

Although the bookstore itself works great. Nice job!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found