Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getPayload generate import map only in Next.js, move ws dependency to @payloadcms/next #9371

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Nov 20, 2024

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:
image

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.

@r1tsuu r1tsuu force-pushed the fix/get-payload-without-next-js branch from 03cffa2 to 925cb03 Compare November 20, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant