Hi,
I've updated a preview url in Settings>Preview from http://localhost:3000 to http://localhost:4000. Now the preview on localhost works only on draft pages. On published pages I always land on the homepage.
I've taken a look at this troubleshoot guide, but it did not help. When I copy-paste the preview token in the URL to test in the Rest API, I got "586 documents found" but I cannot see my preview.
The preview on Production works still fine on draft and published pages. I did not change the URL there.
So the code works for Production and the previous localhost but does not work for the new localhost.
What am I missing to make the new localhost preview URL work?
I’ve tried to reproduce the issue on my local machine, and it seems to be working fine, I have modified the port by doing: gatsby develop -p 4000
And in my Prismic configurations and I’ve added “http://localhost:4000”.
Can you try to open the preview in an incognito tab? Also are you sure that you didn’t change your link resolver implementation or the link resolver setting in your repo?
Hi Fares,
I see that could not reproduce the bug we are having .
I tried in incognito window and the issue is still there, still landing on the homepage for published pages only (still all good for draft pages).
No we did not make any change in the code itself while we were changing the localhost URL.
We also change the staging url at the same time. We have the same issue on both the new localhost and the new staging urls.
However, the previews on the old localhost and the production url are working fine.
So if you confirm that we only need to change the localhost port (or stagin URL) and to add the new preview URL in the Prismic configuration, then that’s what we did. So I’m wondering what is preventing the preview on published pages
I’m Anne, Camille’s colleague and working on the same project. I was wondering if there’s any news on this bug as it persists for us and we still couldn’t find out why it’s happening. We’d be happy about ideas! Thanks
This is a really strange one we haven’t seen before, can you try deleting your node modules and re-running npm install. Also at the same time run gatsby clean to see if that resets anything.
One question thought why did you change the port? Would switching back to http://localhost:3000 help?
Thanks.
1 Like
Fares
closed , flag & select 'Something Else' to reopen.
17