Cleave.js: Importing cleave.js for react does not work in Version 1.3.1

Created on 9 Apr 2018  路  7Comments  路  Source: nosir/cleave.js

Using Version 1.3.1 and trying to import cleave for eact

import Cleave from 'cleave.js/react';

results in error

ERROR in ./src/xxx/yyy.js
Module not found: Error: Can't resolve 'cleave.js/react' in 'xx/yyy/zzz.js'

using Version 1.2.0 works fine.

resolved urgent bug

Most helpful comment

Things started working again :D

All 7 comments

I can confirm this is happening!

This seems to be because package.json contains
"version": "1.3.1",
"files": [
"src",
"dist"
],

thus we only include folders src and dist

react.js is not included

https://docs.npmjs.com/files/package.json#files

I don't know if this is really the problem, since the dist folder contains the cleave-react.js file too...

A quick and easy way to test, this is the case:
in any app using import Cleave from 'cleave.js/react';
with cleave 1.3.1 when we try to start/build the project, it gives an error
Module not found: Error: Cannot resolve module 'cleave.js/react' in .....

go to node_modules\cleave.js and put the file react.js (from version 1.2.1 or root of this repo)
try to start/build the project again, then it is OK.

I will try to provide a complete example soon.

Sorry guys,
I鈥檝e merged the PR.
Will bump version and release when home.

Hi guys. Fix released as v1.3.2, published in npm, sorry again.
Can I close this?

Things started working again :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

d3bgger picture d3bgger  路  4Comments

YanikCeulemans picture YanikCeulemans  路  3Comments

yardz picture yardz  路  6Comments

fcoms picture fcoms  路  3Comments

Scit picture Scit  路  4Comments