buildo / react-autosize-textarea

A textarea perfectly compatible with ReactJS default one which auto resizes its height based on user input.
http://react-components.buildo.io/#textareaautosize
MIT License
488 stars 85 forks source link

Bug with latest version of autosize #152

Open himynameistimli opened 3 years ago

himynameistimli commented 3 years ago

Hi,

An update was added to autosize in version 4.0.3 yesterday that causes an autosize is not a function error when rendering the react-autosize-textarea component.

This didn't occur locally, only in our production builds, but we fixed it by specifying the exact version of autosize (4.0.2) in our package directly.

denindka commented 3 years ago

It still install 4.0.3. How to fix this ?

gkumar-mdsol commented 3 years ago

I also started facing the same issue since this morning. I just locked the autosize version to 4.0.2 in my package.json file and it worked.

I just added a preinstall script inside scripts of package.json and locked autosize version to 4.0.2 Make sure resolutions should be outside the scripts

"preinstall": "npx npm-force-resolutions",

"resolutions": { "autosize": "4.0.2" }

angelogiuseppe commented 3 years ago

To anyone experiencing this issue, feel free to try: https://www.npmjs.com/package/force-resolutions

Just change:

"preinstall": "npx npm-force-resolutions"

To:

"preinstall": "npx force-resolutions"

npx force-resolutions does not run when no package-lock.json is detected, and allows the next command inline to be executed as normal. This is useful when installing dependencies for a package that has been already published where package-lock.json is not available.

Feedback and PR's are welcome