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

[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

Closed
SammyGutierrez335 opened this issue Apr 29, 2024 · 4 comments · Fixed by #12957
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

Comments

@SammyGutierrez335
Copy link

SammyGutierrez335 commented Apr 29, 2024

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

@SammyGutierrez335 SammyGutierrez335 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Apr 29, 2024
@SammyGutierrez335 SammyGutierrez335 changed the title My print export is failing and the logs displays 'rows must have unique ids'. 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 Apr 29, 2024
@michelengelen michelengelen changed the title 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 [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 Apr 30, 2024
@michelengelen
Copy link
Member

Hey @SammyGutierrez335 ... could you try and create a minmial reproduction case in stackblitz or codesandbox. Without this we probably won't be able to help you.

@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information feature: Export and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 30, 2024
@SammyGutierrez335
Copy link
Author

Yes of course. Here is the link
https://stackblitz.com/edit/vitejs-vite-wjyjyj?file=src%2FApp.tsx

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Apr 30, 2024
@michelengelen
Copy link
Member

ok, thanks ... its actually a duplicate of #12946 ...
I will link the PR here so you can see when the fix gets merged.
Thanks for raising this!

@michelengelen michelengelen added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 2, 2024
Copy link

github-actions bot commented May 2, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@SammyGutierrez335: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants