[data grid] My print export is failing with 'MIME type ('text/html') is not a supported stylesheet MIME type' and 'rows must have unique ids' on export customization #12942
Labels
component: data grid
This is the name of the generic UI component, not the React module!
duplicate
This issue or pull request already exists
feature: Export
support: commercial
Support request from paid users
The problem in depth
I am using a customtoolbar with misc GridToolbarButton components inside a GridToolbarContainer. Inside that container I also have the GridToolbarExport component. By default it has CSV, Excel, and Print. CSV and Excel work just fine out of the box but I have passing a csv and excel option prop to customize filename, and ensure aggregation/sum is included in export.
When I attempt to use the the default print export, nothing happens on click. The console pops up an error 'Refused to apply style from 'https://localhost/modules/fonts/index.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.' and when I try to override the export using printExport options (similar to csv and excel) per the documentation I get a message along the lines of each row must have a valid id even though I am setting the row index as the id.
I have also attempted to generate a random UUID and get the same error message.
I have console logged my rows prior to printing to ensure they have unique ids but I still receive that error.
Your environment
`npx @mui/envinfo`
System:
OS: Windows 11 10.0.22631
Binaries:
Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Version 124.0.6367.91 (Official Build) (64-bit)
Edge: Chromium (123.0.2420.97)
npmPackages:
@emotion/react: ^11.11.1 => 11.11.1
@emotion/styled: ^11.11.0 => 11.11.0
@mui/base: 5.0.0-beta.16
@mui/core-downloads-tracker: 5.15.14
@mui/icons-material: ^5.14.3 => 5.14.9
@mui/lab: ^5.0.0-alpha.143 => 5.0.0-alpha.145
@mui/material: ^5.15.14 => 5.15.14
@mui/private-theming: 5.15.14
@mui/styled-engine: 5.15.14
@mui/styles: ^5.0.1 => 5.0.1
@mui/system: ^5.14.5 => 5.15.14
@mui/types: 7.2.14
@mui/utils: 5.15.14
@mui/x-data-grid: 6.19.8
@mui/x-data-grid-premium: ^6.19.8 => 6.19.8
@mui/x-data-grid-pro: 6.19.8
@mui/x-date-pickers: 6.14.0
@mui/x-date-pickers-pro: ^6.12.1 => 6.14.0
@mui/x-license-pro: 6.10.2
@mui/x-tree-view: 6.0.0-alpha.1
@types/react: ^18.2.74 => 18.2.74
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
typescript: ^4.9.5 => 4.9.5
Search keywords: Print Export Premium Data Grid Rows Unique Id
Order ID: 2c1ec6b8464ce7f677114b6b45b0b825Tz03NzUwMCxFPTE3Mjk5NjU4OTgwMDAsUz1wcmVtaXVtLExNPXN1YnNjcmlwdGlvbixLVj0y
The text was updated successfully, but these errors were encountered: