react-dnd icon indicating copy to clipboard operation
react-dnd copied to clipboard

Identifier import type error : Cannot find module 'dnd-core' or its corresponding type declarations

Open celioFagundes opened this issue 3 years ago • 3 comments

I was following the simple sortable example at https://react-dnd.github.io/react-dnd/examples/sortable/simple, it's working but i'm getting this error whem trying to import the Identifier type import type { Identifier } from 'dnd-core'; Cannot find module 'dnd-core' or its corresponding type declarations

i'm using:

  • NextJs 13.0.2
  • React : 18.2.0
  • React-dnd: 16.0.1
  • React-dnd-html5-backend: 16.0.1
  • Pnpm : 7.16.0
  • Typescript: 4.8.4

celioFagundes avatar Nov 17 '22 16:11 celioFagundes

I guess, you would need to add dnd-core as a dependency in your app. react-dnd depends on it itself (so it is already in your node_modules), but you don't have it in the scope of your app, so you have a TS error.

keXXpert avatar Dec 29 '22 11:12 keXXpert

This shows as an error in the example linked from the site: image

nicktobolski avatar Dec 12 '24 00:12 nicktobolski

This is what I have used..

pnpm add dnd-core -D

afatoga avatar Dec 17 '24 09:12 afatoga