Hey there, I want to use Lit on React for
ui
field on payload. I use
@lit-labs/react
to do it.
always got
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/payload/node_modules/lit-element/index.js from /path/payload/src/lit-components/test/my-element.js not supported.
Instead change the require of index.js in /path/payload/src/lit-components/test/my-element.js to a dynamic import() which is available in all CommonJS modules.
Is there any way to implement Lit with Payload?
Has someone done this (Lit+React) in payload before?
That package appears to be ESM-only, so this won't be possible currently unless you introduce some sort of bundling to get a cjs output. This is an node-wide ecosystem problem at the moment.
yeah already solved using rollup, to have cjs output
Star
Discord
online
Get dedicated engineering support directly from the Payload team.