faustjs icon indicating copy to clipboard operation
faustjs copied to clipboard

Bug: Preview button redirect incorrect url on Netlify

Open NguyenQuocThinh13 opened this issue 2 years ago • 2 comments

Hi, currently i'm trying to implement the preview feature with Wordpress Faustjs and Nextjs using this document as reference https://faustjs.org/guide/how-to-setup-post-and-page-previews. It worked on localhost and other hosting platform (Vercel, Atlas) but on Netlify it's only redirect to "/" endpoint (it should be "/preview")

Applicable Versions

  • "@faustwp/blocks": "^2.0.0",
  • "@faustwp/cli": "1.0.1",
  • "@faustwp/core": "1.0.3"

Steps To Reproduce

  1. Change faust frontend URL on your setting with your Netlify app URL
  2. Update content on Wordpress draft page that not the front page (ex: test-page)
  3. Click preview button and open in new tab

The current behavior

It's redirect to the wrong URL netlify-site.netlify.app instead of netlify-site.netlify.app/preview (Sorry i can't provide my current site as it is my client websites)

The expected behavior

It should redirect to preview url with /preview endpoint which will render the right preview page

I'd appreciate it if someone from the community or the maintainers could provide some guidance on how I can enable and handle the preview mode in my Next.js v13 application.

Best regards,

NguyenQuocThinh13 avatar Aug 17 '23 08:08 NguyenQuocThinh13

@NguyenQuocThinh13 can you provide a minimal repo for reproducing this problem? Thank you!

mindctrl avatar Aug 23 '23 14:08 mindctrl