You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main issue that I have, is that while having NEXT_PUBLIC_SERVER_URL=http://localhost:3001, the live preview functionality works fine. However, when changing it to NEXT_PUBLIC_SERVER_URL=http://test.127.0.0.1.sslip.io:3001, it does not work anymore.
*.127.0.0.1.sslip.io is a wildcard DNS for - in this case - 127.0.01.
Most of the code are 1-1 of the website template, when it comes to live preview.
Clone my repository and check out branch payload-livepreview-issue.
Copy .env.example to .env
Toggle the NEXT_PUBLIC_SERVER_URL to the second one (so value should be http://localhost:3001.
Run docker compose up -d to start the Postgres database container.
Build the image with the provided ./build.sh script. You may need to run chmod +x build.sh
5.1. Seeing how I structured my initial seeding, you need to run this twice. The first build should fail on some email field.
Once build, start the container with executing ./start.sh. You may need to run chmod +x start.sh first.
Go to the backend to http://localhost:3001/admin with [email protected] as email, password as password (as per .env).
7.1. Edit the first project (http://localhost:3001/admin/collections/projects/1) and press "Live Preview".
7.2. Make changes in the "Detail" tab (content editor) and see that it will be reflected in the preview.
Now, stop the start.sh script and make changes to .env. Ensure that NEXT_PUBLIC_SERVER_URL=http://test.127.0.0.1.sslip.io:3001 is now uncommented.
Closed; it appears that once you leave "localhost" as domain, you need to provide a valid SSL connection as NextJS sends some secure cookies when entering live-preview/draft modus.
Describe the Bug
More context, see Discord; https://discord.com/channels/967097582721572934/1301603163329265718
The main issue that I have, is that while having
NEXT_PUBLIC_SERVER_URL=http://localhost:3001
, the live preview functionality works fine. However, when changing it toNEXT_PUBLIC_SERVER_URL=http://test.127.0.0.1.sslip.io:3001
, it does not work anymore.*.127.0.0.1.sslip.io
is a wildcard DNS for - in this case - 127.0.01.Most of the code are 1-1 of the website template, when it comes to live preview.
Branch: https://github.com/Thijmen/thijmen.dev/tree/payload-livepreview-issue
Link to the code that reproduces this issue
https://github.com/Thijmen/thijmen.dev/tree/payload-livepreview-issue
Reproduction Steps
payload-livepreview-issue
..env.example
to.env
NEXT_PUBLIC_SERVER_URL
to the second one (so value should behttp://localhost:3001
.docker compose up -d
to start the Postgres database container../build.sh
script. You may need to runchmod +x build.sh
5.1. Seeing how I structured my initial seeding, you need to run this twice. The first build should fail on some email field.
./start.sh
. You may need to runchmod +x start.sh
first.http://localhost:3001/admin
with[email protected]
as email,password
as password (as per.env
).7.1. Edit the first project (http://localhost:3001/admin/collections/projects/1) and press "Live Preview".
7.2. Make changes in the "Detail" tab (content editor) and see that it will be reflected in the preview.
start.sh
script and make changes to.env
. Ensure thatNEXT_PUBLIC_SERVER_URL=http://test.127.0.0.1.sslip.io:3001
is now uncommented../build.sh
../start.sh
Which area(s) are affected? (Select all that apply)
area: core, area: templates
Environment Info
Binaries:
Node: 20.12.2
npm: 10.5.0
Yarn: 1.22.22
pnpm: 9.12.2
Relevant Packages:
payload: 3.0.0-beta.118
next: 15.0.1
@payloadcms/db-postgres: 3.0.0-beta.118
@payloadcms/email-nodemailer: 3.0.0-beta.118
@payloadcms/graphql: 3.0.0-beta.118
@payloadcms/live-preview: 3.0.0-beta.118
@payloadcms/live-preview-react: 3.0.0-beta.118
@payloadcms/next/utilities: 3.0.0-beta.118
@payloadcms/plugin-cloud: 3.0.0-beta.118
@payloadcms/plugin-cloud-storage: 3.0.0-beta.118
@payloadcms/plugin-form-builder: 3.0.0-beta.118
@payloadcms/plugin-nested-docs: 3.0.0-beta.118
@payloadcms/plugin-redirects: 3.0.0-beta.118
@payloadcms/plugin-seo: 3.0.0-beta.118
@payloadcms/richtext-lexical: 3.0.0-beta.118
@payloadcms/translations: 3.0.0-beta.118
@payloadcms/ui/shared: 3.0.0-beta.118
react: 19.0.0-rc-65a56d0e-20241020
react-dom: 19.0.0-rc-65a56d0e-20241020
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:25 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6030
Available memory (MB): 36864
Available CPU cores: 12
The text was updated successfully, but these errors were encountered: