Open d8corp opened 6 months ago
Stackblitz doesnt configure the browser
condition here and it picked up a bundle that is meant to be loaded in server environments.
I updated react-textarea-autosize in my project from 6.1.0 to 8.5.3 to have ref prop and it had broken. the 6.1.0 works on Stackblitz (https://stackblitz.com/edit/stackblitz-starters-enhi95?file=src%2Findex.tsx)
What bundler do you use in your project?
webpack, babel-loader 7.1.2 works fine
What version of webpack? is it a custom configuration or are you using it through some framework~?
Custom configuration, webpack 4.
@Andarist I have the same problem. Changing the "browser" property of package.json from
"browser": {
"./dist/react-textarea-autosize.esm.js": "./dist/react-textarea-autosize.browser.esm.js"
},
to
"browser": {
"./dist/react-textarea-autosize.esm.js": "./dist/react-textarea-autosize.browser.esm.js",
"./dist/react-textarea-autosize.cjs.js":"./dist/react-textarea-autosize.browser.cjs.js"
},
seems to solve the problem. I'm still using browserify, though. Is there a reason not to include the cjs version in the "browser" object?
I create the simplest example with latest versions of libs and chrome. It does not change the textarea height.
Check it here: https://stackblitz.com/edit/stackblitz-starters-3yw9em?file=src%2Findex.tsx