Andarist / react-textarea-autosize

<textarea /> component for React which grows with content

Home Page:http://andarist.github.io/react-textarea-autosize/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSR-only Error with NextJS on Edge Runtime - "document is not defined"

BlueSkyDev05 opened this issue · comments

I am currently encountering a server-side rendering (SSR) specific issue with NextJS operating on Edge Runtime, where a runtime error is thrown during SSR.

Even though the app works fine on the client side, server-side rendering (SSR) fails and results in an empty initial html response.

I'm not directly using this package. It's indirectly applied as part of the '@mantine/core' package.

Here's the full traceback for extra context:

ReferenceError: document is not defined
    at (../../node_modules/react-textarea-autosize/dist/react-textarea-autosize.browser.esm.js:100:0)
    at (webpack/bootstrap:21:0)
    at (../../node_modules/@mantine/core/cjs/components/Textarea/Textarea.js:6:23)
    at (webpack/bootstrap:21:0)
    at (../../node_modules/@mantine/core/cjs/components/JsonInput/JsonInput.js:8:15)
    at (webpack/bootstrap:21:0)
    at (../../node_modules/@mantine/core/cjs/index.js?4f1e:199:16)
    at (webpack/bootstrap:21:0)
    at (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js:26:18)
    at (../../node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js:23:65)

I would appreciate any guidance or help you could provide on this issue. Thanks in advance.