react-textarea-autosize: [v8] SSR support is broken

It seems, like with introduction of v8 this issue has returned We are using this package with next v11.0.1 and getting the following error, when trying to start our application:

“ReferenceError: document is not defined”

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 9
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I’m running into this problem when using the Next.js Edge Runtime with SSR as well.

Thanks. Unfortunately throws an error while generating the og image on api/og route in next.js:

Uncaught TypeError: (0 , Xo.default) is not a function
    at <unknown> (webpack-internal:///(:3000/api/og/middleware)/./node_modules/satori/dist/index.wasm.cjs:9)
    at eval (webpack-internal:///(:3000/api/og/middleware)/./node_modules/satori/dist/index.wasm.cjs:9:1726)
    at Object.(middleware)/./node_modules/satori/dist/index.wasm.cjs (:3000/api/og/evalmachine.<anonymous>:2352:1)
    at __webpack_require__ (:3000/api/og/evalmachine.<anonymous>:37:33)
    at fn (:3000/api/og/evalmachine.<anonymous>:296:21)
    at eval (webpack-internal:///(:3000/api/og/middleware)/./node_modules/@vercel/og/dist/index.js:5:69)
    at Module.(middleware)/./node_modules/@vercel/og/dist/index.js (:3000/api/og/evalmachine.<anonymous>:2484:1)
    at __webpack_require__ (:3000/api/og/evalmachine.<anonymous>:37:33)
    at fn (:3000/api/og/evalmachine.<anonymous>:296:21)
    at eval (webpack-internal:///(:3000/api/og/middleware)/./pages/api/og.tsx:11:68)
    at Module.(middleware)/./pages/api/og.tsx (:3000/api/og/evalmachine.<anonymous>:869:1)

Probably because satori package is incompatible with the worker condition?

SSR should not reach for react-textarea-autosize.browser.esm.js. This is a browser build - this means that your bundler is configured incorrectly.