{"id":682,"hash":"5d40ac124cb0644061e4ac03a0a75d6e298f22c15a95cff79447b3803d0935a3","pattern":"Testing error after upgrading @mui/x-data-grid to v8.1.0 – Unknown file extension &quot;.css&quot;","full_message":"After upgrading @mui/x-data-grid to version 8.1.0, I started encountering the following error while running unit tests using Vitest in my ReactJS application\n\nTypeError: Unknown file extension \".css\" for D:\\node_modules\\@mui\\x-data-grid\\esm\\index.css\n\nIt seems that Vitest is unable to handle .css imports from the MUI package.\n\nHow can I resolve this error and properly configure my test environment to handle CSS imports from @mui/x-data-grid when using Vitest?\n\nAny help or best practices for resolving this kind of issue would be appreciated.","ecosystem":"npm","package_name":"reactjs","package_version":null,"solution":"I solved this by adding this to my vitest.config.ts\n\nexport default defineConfig({\n    test: {\n        server: {\n            deps: {\n                inline: [\"@mui/x-data-grid\"],\n            },\n        },\n    }\n}\n\nHere is some more about that method","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/79592526/testing-error-after-upgrading-mui-x-data-grid-to-v8-1-0-unknown-file-extensio","votes":6,"created_at":"2026-04-19T04:51:28.859096+00:00","updated_at":"2026-04-19T04:51:28.859096+00:00"}