Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
After the change with removing getPayloadHMR, we do generate import map even outside of Next.js, which leads to errors when using in a project without it:
Also, the ws dependency shouldn't be included to the payload package, instead we can move it @payloadcms/next and import dynamically and we shouldn't try to connect to the Next.js WebSocket server if we're not inside of Next.js.
Now, to control this we use the PAYLOAD_NEXT_INTEGRATION = 'true' env variable which we add in withPayload.
After the change with removing
getPayloadHMR
, we do generate import map even outside of Next.js, which leads to errors when using in a project without it:Also, the
ws
dependency shouldn't be included to thepayload
package, instead we can move it@payloadcms/next
and import dynamically and we shouldn't try to connect to the Next.js WebSocket server if we're not inside of Next.js. Now, to control this we use thePAYLOAD_NEXT_INTEGRATION = 'true'
env variable which we add inwithPayload
.