mantine-datatable icon indicating copy to clipboard operation
mantine-datatable copied to clipboard

styles breaks next middleware / next-intl locale

Open HarleySalas opened this issue 1 year ago • 1 comments

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 avatar Nov 23 '23 20:11 HarleySalas

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.

HarleySalas avatar Nov 23 '23 23:11 HarleySalas