Kikobeats / react-clap-button

A Medium like clap button
https://react-clap-button.netlify.com
120 stars 17 forks source link

Module not found #45

Closed adjwills closed 5 years ago

adjwills commented 5 years ago

Following basic usage outlined, i.e. install package

npm install react-clap-button --save

and then importing ClapButton

import ClapButton from 'react-clap-button';

Creates error

Module not found: Can't resolve 'react-clap-button'

Looks like the module is missing the src files upon installation? I did it with a fresh CRA react app, and got the same issue.

Kikobeats commented 5 years ago

Hello, that's because main is referenced in the compiled version of the source code.

It should be fixed after add postinstall script.

Can you confirm to me if v1.1.4 is working fine for you?

adjwills commented 5 years ago

Hey, no worries.

Same issue for v1.1.4 and v1.1.3 it seems. However, v.1.1.2 and below seem to work

Kikobeats commented 5 years ago

v.1.12 is exporting main lib/index.js and this file doesn't exit in the zip I downloaded 🤔

Kikobeats commented 5 years ago

Can you try to edit main file manually? maybe could be a thing related of what code bundler are you using?

adjwills commented 5 years ago

Testing this on a create-react-app install using webpack, have tried installing with yarn and npm. Still no joy for now.