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] useGridRootProps throw error in production, but not locally. #6951

Closed
2 tasks done
arifannosh opened this issue Nov 22, 2022 · 9 comments
Closed
2 tasks done
Labels
component: data grid This is the name of the generic UI component, not the React module! support: commercial Support request from paid users

Comments

@arifannosh
Copy link

arifannosh commented Nov 22, 2022

Order ID 💳

54600

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

The problem in depth 🔍

It works fine on my local system when deployed the below error is occur:

2.75682452.chunk.js:2 MUI: GridErrorHandler - An unexpected error occurred. Error: MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component..  Error: MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component

Your environment 🌎

"@material-ui/core": "^4.11.4", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.58", "@mui/icons-material": "^5.6.2", "@mui/material": "^5.4.4", "@mui/x-data-grid-premium": "^5.17.12", npm 6.14.15 node v14.17.6
  chrome 

@arifannosh arifannosh added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Nov 22, 2022
@flaviendelangle
Copy link
Member

Hi,
Thanks for your contribution.

Could you provide a working reproduction, this Codesandbox template might be a good starting point.

@flaviendelangle flaviendelangle added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 22, 2022
@arifannosh
Copy link
Author

@flaviendelangle plz check I just update Codesandbox template with my code

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Nov 22, 2022
@arifannosh
Copy link
Author

please have look Example

@arifannosh
Copy link
Author

{/* } nonce={undefined} onResize={undefined} onResizeCapture={undefined} /> */}
  the custom toolbar creates an issue 

@joserodolfofreitas joserodolfofreitas changed the title 2.75682452.chunk.js:2 MUI: GridErrorHandler - An unexpected error occurred. Error: MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.. Error: MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.[question] [Data Grid] useGridRootProps throw error in production, but not locally. Nov 22, 2022
@joserodolfofreitas
Copy link
Member

Hi @arifannosh,

I did a build (with yarn build) using the App.tsx on your example, and I couldn't reproduce the problem.
What's the process you're using to "deploy"?

@m4theushw m4theushw changed the title [Data Grid] useGridRootProps throw error in production, but not locally. [data grid] useGridRootProps throw error in production, but not locally. Nov 22, 2022
@m4theushw m4theushw added the component: data grid This is the name of the generic UI component, not the React module! label Nov 22, 2022
@arifannosh
Copy link
Author

yes @m4theushw it only gives an error on production, not on local or in a build

@joserodolfofreitas
Copy link
Member

What do you mean by "production", @arifannosh? What's the process you're using to deploy your application?

@arifannosh
Copy link
Author

@joserodolfofreitas and @flaviendelangle I just found a workaround
this is an issue with GridToolbarContainer and GridToolbar components of x-grid-premium. I import those two components for x-grid-pro it works fine for me now

@m4theushw
Copy link
Member

I'm closing because we can't reproduce this problem.

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! support: commercial Support request from paid users
Projects
None yet
Development

No branches or pull requests

4 participants