Conflict Between next-intl createNavigation
and pigment-css Styling with MUI
#365
Labels
docs
Improvements or additions to the documentation
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
support: question
Community support but can be turned into an improvement
Description
I am implementing internationalization in a Next.js app using
next-intl
. Following the official i18n routing guide, I created a locale switcher in the header. While adapting the locale switcher to use MUI'sSelect
component, I encountered a critical issue when applying styles via thesx
prop orstyled
frompigment-css
.If I include any of the hooks from
createNavigation
in the component and apply anysx
styling or usestyled
, the server crashes with the following error:Steps to Reproduce
Current Behavior
The server crashes with the above error when using any of the hooks from
createNavigation
and and styling (sx
orstyled)
coexist in the component.Expected Behavior
The hooks and styling should work together without causing a server crash.
Code Example
I reproduced the issue on a Codesandbox example.
Just comment in one of the
sx
props marked in theLocaleSwitcherSelect
component.Environment
Next.js: 15.1.4
React: 19.0.0
next-intl: 3.26.3
MUI 6.3.1
pigment.css: 0.0.29
Notes
The issue seems tied to the interplay between createNavigation and styling, possibly related to how next-intl manages routing. The error trace doesn't provide a clear path to resolution.
I am aware this bug does not lead directly to pigment-css, but the way it emerges and the fact that the library is still in alpha leads me to posting the problem here first.
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: