Skip to content
Discussion options

You must be logged in to vote

During the build (npm run build) Next.js is trying to make a request to the API (fetchDomains), which is not available at the build stage, since it is located in a closed Kubernetes network. This leads to an assembly error.
You need to prevent this request from being executed during the build and make sure that the data is requested only at the execution stage. To do this, you can use the dynamic behavior of the page by disabling static generation.
To change the page rendering to server-side: Add export const dynamic = 'force-dynamic'; to page.tsx. This will force Next.js render the page only on the server and do not try to do static generation.

// page.tsx
export const dynamic = 'force-d…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by willredington
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants