icflorescu / mantine-datatable

The table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, context menus, nesting, Gmail-style batch row selection, dark theme, and more.
https://icflorescu.github.io/mantine-datatable/
MIT License
950 stars 68 forks source link

styles breaks next middleware / next-intl locale #478

Open HarleySalas opened 12 months ago

HarleySalas commented 12 months ago

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 commented 12 months ago

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.