-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't get shop to pre-render page #746
Conversation
Signed-off-by: Akarshit Wal <[email protected]>
8fa6638
to
83341b6
Compare
I feel like there should be a general solution to this: #718 Yes, the api would need to be reachable during build time currently. I doubt however that fully opting out and server-rendering per request instead is a better solution to this. |
Signed-off-by: Akarshit Wal <[email protected]>
The build is failing because of some other reason. I can see that happening in other PRs too. |
Signed-off-by: Akarshit Wal <[email protected]>
Hey @Akarshit - I just followed the steps listed to test and still get the same bug. Am I missing something? 🤔 |
@jrw421 Hmm, can't say for sure. We can do a quick screen-sharing session to sort this out... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and looks good! 🎉
Resolves #742
Impact: critical
Type: bugfix
Issue
The cart page was being saved on build time, which was causing the
shop
to null as there was no server to get the shop from during build time.Also the all the pages were being re-built after 2 mins, because of a wrong variable check.
Solution
Now the shop would be fetched from the backend on every request. Fixed the variable check to recreate the page when the
shop
is not present.Breaking changes
None expected.
Testing
make
reaction_api
usingdocker stop reaction_api_1
. This would simulate the circle CI build env in which the server is not running.docker build --network=host -t reactioncommerce/example-storefront:test-me .
inexample-storefront
directorymake init-reaction
docker run -it --name storefront -p 4000:4000 --env-file .env.prod --network reaction.localhost reactioncommerce/example-storefront:test-me
. If you get an error that/storefront
is being used by XXX, dodocker rm XXX
There are other pages that use
unstable_revalidate
, but I was getting very sketchy behavior on the first load using that. So I thought it might be better to remove SSR for now, and if needed people can extend and add that according to their need. The behaviour is explained in the linked issue.