Next.js Discord

Discord Forum

SCSS Module Import Inconsistency with Turbopack in Next.js 15.3.1

Unanswered
Mini Rex posted this in #help-forum
Open in Discord
Mini RexOP
When a component importing CSS modules is rendered purely client-side, Turbopack fails to include the necessary CSS chunk in the bundle. However, the exact same component works perfectly when server-rendered. Surprisingly it also works fine with the rest of the page's client side component's style module imports, only the "navbar" component seem's to be not getting back it's chunk of css module.

1. Chunk: %5Broot-of-the-server%5D__f2638588._.css (Base styles)
2. Chunk: apps_next-frontend_src_components_bf7ad37b._.css (Component styles) - in this file, the specific component's css chunk is missing only when rendered client side completely.

Has anyone encountered this selective CSS module omission with Turbopack, where specific components lose their CSS chunks in client-side scenarios?

1 Reply

Mini RexOP
This issue is specifically with turbopack alone, normal one works perfectly fine