Skip to content
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

Make production build works by opt-out static build for search pages #318

Merged
merged 1 commit into from Aug 20, 2020

Conversation

MrOrz
Copy link
Member

@MrOrz MrOrz commented Aug 19, 2020

Currently staging build fail because /search page is using a runtime config.

image

According to next.js doc:

A page that relies on publicRuntimeConfig must use getInitialProps to opt-out of Automatic Static Optimization. Runtime configuration won't be available to any page (or component in a page) without getInitialProps.

We should pass {ssr: true} to withApollo so that next-apollo attaches getInitialProps to search page and thus opt-out Automatic Static Optimization for /search page.

Result

image

@MrOrz MrOrz self-assigned this Aug 19, 2020
@MrOrz MrOrz merged commit 88f95d4 into dev Aug 20, 2020
@MrOrz MrOrz deleted the fix-build branch September 12, 2020 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants