This issue has been closed due to inactivity.
For anyone coming to this in the future:
If you've done all the right steps and previews still aren't working for you, check if your browser is disabling 3rd party cookies. These cookies are necessary to have to the preview functionality work at all.
In Chrome, a little eye pops up in the right side of the address bar that shows cookies are being blocked when you click on it. It gives you an option "Site not working?", that will enable the cookies.
For me, doing this on my preview sites allowed previews to work. You may be having other issues, but this is worth noting as all the code in the world will not prevent this issue
1 Like