[question] Usage of Excel export with CSP header #9572
Labels
component: data grid
This is the name of the generic UI component, not the React module!
plan: Premium
Impact at least one Premium user
support: commercial
Support request from paid users
support: question
Community support but can be turned into an improvement
Order ID
69724
Duplicates
Latest version
The problem in depth 🔍
I'm trying to use the Excel export feature with the premium Data Grid. My application is deployed with a NGINX server which adds a CSP header with
script-src 'self';
. When using the export, the script is blocked by the CSP header because of aFunction
instruction.I traced the cause to the library regenerator-runtime, used by ExcelJS. This seems to be a known issue: exceljs/exceljs#713 and facebook/regenerator#378 (comment)
I use vite to build my application, I managed to "fix" the problem by adding this to the vite config:
My question is: have you ever encountered this problem and do you have a better solution to solve it?
Your environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: