mlaursen/react-md

@react-md/states cannot resolve classnames

melchor629 opened this issue · 0 comments

Describe the bug

I was migrating react-md v1 to v2 and removed the v1 version with npm uninstall react-md. This action caused the following error to show up:

./node_modules/@react-md/states/es/useInteractionStates.js
Module not found: Can't resolve 'classnames' in '.../node_modules/@react-md/states/es'

To Reproduce

Don't have a really way to reproduce this (yet) but it might be like that:

  • Install react-md v1
  • Install some packages from v2 version, and specially @react-md/states
  • Remove react-md v1

Expected behavior

Everything working fine.

Platform

  • Windows 10 1804
  • node 12.22.1
  • npm 6.14.12

Additional context

I've found that after removing the react-md v1 package, all classnames installations are inside each @react-md/* package that references it (probably npm thought this was a good idea). But @react-md/states does not reference classnames (see package.json) but it is being used in useInteractionStates.js.

Installing classnames manually works, but it is a workaround, I prefer not to have this package installed manually. So I removed it and, in my case at least, running npm dedupe fixed the issue for now.