Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

styles breaks next middleware / next-intl locale #478

Open
HarleySalas opened this issue Nov 23, 2023 · 1 comment
Open

styles breaks next middleware / next-intl locale #478

HarleySalas opened this issue Nov 23, 2023 · 1 comment

Comments

@HarleySalas
Copy link

HarleySalas commented Nov 23, 2023

Describe the bug
Upon importing mantine-datatable/styles.css, or the layers alternative, I get the following error, while using next-intl:

 ✓ Compiled in 1082ms (3375 modules)
locale: en
locale: _next
 ⨯ node_modules\next-intl\dist\esm\server\RequestLocale.js (1:609) @ eval
 ⨯ Error: Unable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale
    at stringify (<anonymous>)
null
 ⨯ node_modules\next-intl\dist\esm\server\RequestLocale.js (1:609) @ eval
 ⨯ Error: Unable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale
    at stringify (<anonymous>)
digest: "2059184074"

To Reproduce
Steps to reproduce the behavior:

  1. Install next-intl@latest (v3+) and use createMiddleware to setup it's middleware.
  2. import mantine-datatable/styles.css
  3. Observe errors

Expected behavior
No errors.

I suppose I should be looking in to next-intl as well, to submit a report there, but... it's just odd to me, because this is the only package which causes the error. I import styles from mantine and other libraries without any issues.

@HarleySalas
Copy link
Author

removing line 786 of styles.css resolved it for me.

/*# sourceMappingURL=styles.css.map */

so, as far as I can tell, this sourceMapping is causing some sort of issue with next middleware. I tried importing it from both server and client components as well as a different project and it was all the same result; the error message posted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant