How to use generateStaticParams (Nextjs 14) between two services?

tekkaeePRO

7 months ago

Hi everyone!

I have deployed two services on railway: backend (Rest API) and frontend (Nextjs 14).

I'm trying to use generateStaticParams and bind the backend service to a public user domain. Noticed that the generateStaticParams request doesn't work at Build stage (not getting the list of data from the backend handle).

The backend service has a cors configured for the frontend custom public domain.

Could you please tell me what this problem could be related to and how to solve it?

Solved

1 Replies

7 months ago

Yes, that's because the builder wouldn't have access to the network the way next expects it. To my knowledge: you might want to use getStaticProps with Fallback true or 'blocking'.

Can you try this out and see if it works?


Status changed to Awaiting User Response railway[bot] 7 months ago


Status changed to Solved brody 7 months ago