tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
https://headlessui.com
MIT License
25.81k stars 1.07k forks source link

Remix+Netlify deployment broken #3490

Closed jarimustonen closed 4 days ago

jarimustonen commented 5 days ago

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.1.7 and v2.1.8

What browser are you using?

Does not matter, server-side error on SSR

Reproduction URL

Unfortunately I'm unable to extract minimal setting as the bug is so vague and is reported by Netlify in a such a vague way.

Describe your issue

When upgrading from v2.1.6 to v2.1.7 or v2.1.8, my site stops working on Netlify.

The page itself says:

error decoding lambda response: error decoding lambda response: unexpected end of JSON input

The Netlify function logs contain the following error:

Sep 26, 04:56:33 PM: ReferenceError: Element is not defined
Sep 26, 04:56:33 PM: at file:///var/task/node_modules/@headlessui/react/dist/hooks/use-transition.js:1:412
Sep 26, 04:56:33 PM: at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
Sep 26, 04:56:33 PM: at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
Sep 26, 04:56:33 PM: at async _tryAwaitImport (file:///var/runtime/index.mjs:1008:16)
Sep 26, 04:56:33 PM: at async _tryRequire (file:///var/runtime/index.mjs:1057:86)
Sep 26, 04:56:33 PM: at async _loadUserApp (file:///var/runtime/index.mjs:1081:16)
Sep 26, 04:56:33 PM: at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)
Sep 26, 04:56:33 PM: at async start (file:///var/runtime/index.mjs:1282:23)
Sep 26, 04:56:33 PM: at async file:///var/runtime/index.mjs:1288:1

My project uses Remix and Vite. Running the project locally (even with netlify serve) works just fine.

I have reported this also to Netlify.

Workaround

As a workaround, downgrading to v2.1.6 works.