Bug: Previews always return Post not found
Applicable Versions
-
@faustjs/coreversion: 0.15.7 -
@faustjs/reactversion: 0.15.7 -
@faustjs/nextversion: 0.15.8 - WordPress version: 6.0.2
Steps To Reproduce
- Use quickstart guide https://faustjs.org/docs/next/getting-started#on-macos-linux-or-wsl-bash
- Setup wordpress plugin: front end domain to match nextjs app, checked all of the feature checkboxes
- Enabled graphql public introspection and ran the generate script, then disabled
- Set up .env.local with headless secret key
- Create new post or edit existing and hit preview in new tab
Link to code example:
No public code but I can provide someone on the team access to my repo / wordpress if that helps.
I did add a bunch of logging in the preview.tsx and nothing really stood out obvious there, there's nothing outdated when running npm outdated. The rest of the site content loads just fine so graph is working. It's not behind a cdn or using any custom post types.
Output of console.log(node) on line 10 of preview.tsx
I've also manually run a graphql query to see if the revision was even generated and it does come back with isPreview: true and all
The current behavior
Page does the redirect login flow and does set the auth cookie and confirmed the auth works via the auth hook on another page. End redirect shows loading briefly then post not found.
The expected behavior
The preview of the page
If there's anything I could do to debug this further I'd love to give it a crack.
Hello @dawnerd. Can I ask: did you set the permalink structure? https://faustjs.org/docs/next/getting-started#setting-your-permalinks
Yep, have it set up exactly that way
Hello @dawnerd. Thank you. We might need more information here about this as we cannot reproduce it.
Is it possible to Is it possible to replicate this flow using Chrome Recorder tool?
https://developer.chrome.com/docs/devtools/recorder/
You will have to enable recording as shown in the guide and perform the interactions. Once you hit the 524 take a screen shot and export the recording as JSON and share it here:
Can I also get more information about the deployment server for example:
Provider: (ex AWS, Netlify, Vercel or custom server)
Is the preview page trying to render a CPT that is not registered?
https://github.com/wpengine/faustjs/blob/canary/examples/next/getting-started/src/pages/preview.tsx#L18-L29
Hey @dawnerd, is this still an issue for you?
We have since released a newer version of Faust that uses Apollo.
We have provided some guidance on how to migrate projects using older gQTY version of Faust you may find helpful.