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

[question] Usage of Excel export with CSP header #9572

Closed
2 tasks done
Jul13nT opened this issue Jul 5, 2023 · 3 comments
Closed
2 tasks done

[question] Usage of Excel export with CSP header #9572

Jul13nT opened this issue Jul 5, 2023 · 3 comments
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

Comments

@Jul13nT
Copy link
Contributor

Jul13nT commented Jul 5, 2023

Order ID

69724

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the 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 a Function 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:

build: {
    rollupOptions: {
        output: {
            intro: 'window.regeneratorRuntime = undefined;',
        },
    },
},

My question is: have you ever encountered this problem and do you have a better solution to solve it?

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
  Binaries:
    Node: 18.16.1 - /usr/bin/node
    Yarn: 3.2.4 - /usr/bin/yarn
    npm: 9.5.1 - /usr/bin/npm
  Browsers:
    Chrome: 114.0.5735.198
@Jul13nT Jul13nT added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Jul 5, 2023
@zannager zannager added support: question Community support but can be turned into an improvement component: data grid This is the name of the generic UI component, not the React module! plan: Premium Impact at least one Premium user labels Jul 5, 2023
@m4theushw
Copy link
Member

Answering the question, we've not encountered this issue before because the Excel feature was tested in the docs website, which uses Next.js. I'll keep this issue open in case someone also has this problem, but we don't have a better solution for now.

@m4theushw m4theushw removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 5, 2023
@cherniavskii
Copy link
Member

Closing in favor of #11153

@cherniavskii cherniavskii closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
Copy link

⚠️ 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.

@Jul13nT: 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! 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
Projects
None yet
Development

No branches or pull requests

4 participants