I guess the issue is with SSR, need to inject styles as soon as possible. Here is official manual from Next, depends on your router there are 2 different solutions. If you want - post here details what version of router you have and I will help you with code examples.