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] Uncaught MissingRowIdError: No row with id <id> found #16638

Open
nicolasfripp opened this issue Feb 18, 2025 · 18 comments · Fixed by #17057
Open

[data grid] Uncaught MissingRowIdError: No row with id <id> found #16638

nicolasfripp opened this issue Feb 18, 2025 · 18 comments · Fixed by #17057
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@nicolasfripp
Copy link

nicolasfripp commented Feb 18, 2025

Steps to reproduce

Steps:

  1. I have a datagridpro with one element
  2. I remove the element
  3. The error is shown.

Current behavior

When i remove the last element of the grid, this error is shown in the console.

Expected behavior

I expect to remove the last element and do not receive any errors.

Context

The issue is shown if I add this prop to the DataGridPro component:
getRowClassName={(params) => (params.indexRelativeToCurrentPage % 2 === 0 ? "Mui-even" : "Mui-odd")}
This is happening in the last version of the DataGridPro. If I use for example, "@mui/x-data-grid-pro": "^7.23.5", no error is shown.

Your environment

npx @mui/envinfo
System:
    OS: Linux 6.10 Ubuntu 20.04.6 LTS (Focal Fossa)
  Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
    pnpm: 9.10.0 - ~/.nvm/versions/node/v20.14.0/bin/pnpm
  Browsers:
    Chrome: Not Found
  npmPackages:
    @mui/base: 5.0.0-beta.69 => 5.0.0-beta.69 
    @mui/icons-material: 6.4.4 => 6.4.4 
    @mui/material: 6.4.4 => 6.4.4 
    @mui/styled-engine-sc: npm:@mui/styled-engine-sc@6.4.3 => 6.4.3 
    @mui/system: 6.4.3 => 6.4.3 
    @mui/utils: ^6.4.3 => 6.4.3 
    @mui/x-data-grid: ^7.27.0 => 7.27.0 
    @mui/x-data-grid-pro: ^7.27.0 => 7.27.0 
    @mui/x-date-pickers: ^7.27.0 => 7.27.0 
    @mui/x-date-pickers-pro: ^7.27.0 => 7.27.0 
    @mui/x-license-pro: ^6.10.2 => 6.10.2 
    @types/react: 18.3.13 => 18.3.13 
    react: 18.3.1 => 18.3.1 
    react-dom: 18.3.1 => 18.3.1 
    typescript: ^5.7.3 => 5.7.3 

Search keywords: getRowClassName DataGridPro MissingRowIdError

@nicolasfripp nicolasfripp added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 18, 2025
@github-actions github-actions bot changed the title [DataGridPro] Uncaught MissingRowIdError: No row with id <id> found [data grid] Uncaught MissingRowIdError: No row with id <id> found Feb 18, 2025
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Feb 18, 2025
@michelengelen
Copy link
Member

To help us diagnose the issue efficiently, could you provide a stripped-down reproduction test case using the latest version? A live example would be fantastic! ✨

For your convenience, our documentation offers templates and guides on creating targeted examples: Support - Bug reproduction

Just a friendly reminder: clean, functional code with minimal dependencies is most helpful. Complex code can make it tougher to pinpoint the exact issue. Sometimes, simply going through the process of creating a minimal reproduction can even clarify the problem itself!

Thanks for your understanding! 🙇🏼

@michelengelen michelengelen 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 Feb 19, 2025
@nicolasfripp
Copy link
Author

@michelengelen I couldn't find a way to consistently reproduce it in my application. Sometimes it happens and sometimes it doesn't. I found this from two days ago. It seems to be the same problem I'm facing.

@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 Feb 19, 2025
@michelengelen
Copy link
Member

Could be, but without a solid reproduction which we can look into this is not possible for us to fix. Take this as an example: DEMO

I use a rows state top update the rows and the getRowClassName prop as well that you provided. I am not able to reproduce this bug. That's why I am asking to provide a reproduction example that reliably reproduces the bug so that we can investigate.

@michelengelen michelengelen 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 Feb 19, 2025
@livingforjesus
Copy link

@nicolasfripp Closed the pr because it started working on latest version(was on 7.25.0 then switched to 7.27.0 and it started working). But I got the same error again from a different datagrid table. Main problem is its hard to reproduce

@livingforjesus
Copy link

@michelengelen Created a PR to fix this(and 1 other place that triggers this issue for me). Would appreciate if you took a look
#16672

@lauri865
Copy link
Contributor

lauri865 commented Feb 21, 2025

I can't reproduce this anymore (I did previously). How are y'all deleting the rows?

Wonder if moving this line up a notch would fix any remaining edge cases, but ideally we should have a reproduction so we don't add unnecessary checks that hide the root cause:

if (!rowNode) {
return null;
}

Above this block:

const rowClassNames = apiRef.current.unstable_applyPipeProcessors('rowClassName', [], rowId);

Copy link

The issue has been inactive for 7 days and has been automatically closed.

@craiganderson-iotv
Copy link

craiganderson-iotv commented Mar 4, 2025

I'm currently on 7.27.2 and still encountering an issue as described in #2714 , but only when removing rows from the datagrid.

The only solution I've found is to use key={...} to force the datagrid to rerender, as described in the latest comment.

@ata1704
Copy link

ata1704 commented Mar 5, 2025

We encounter the same issue with version 7.27.2. Due to re-renders, our component receives data for the DataGrid again. As soon as I specify a method at getRowClassName, and even if it only returns an empty string, I get the said error. So this does not necessarily only have something to do with deleting lines.

@romgrk romgrk reopened this Mar 6, 2025
Copy link

github-actions bot commented Mar 7, 2025

The issue has been inactive for 7 days and has been automatically closed.

@github-actions github-actions bot closed this as completed Mar 7, 2025
@craiganderson-iotv
Copy link

The issue has been inactive for 7 days and has been automatically closed.

That's clearly wrong, @romgrk are you able to ensure it stays open?

@arminmeh arminmeh removed the status: waiting for author Issue with insufficient information label Mar 7, 2025
@arminmeh arminmeh reopened this Mar 7, 2025
@annabelhayes
Copy link

annabelhayes commented Mar 10, 2025

For me the issue is reproducible when navigating back to a previously loaded list of results.

  1. Datagrid renders list of rows with ids: [1,2,3], I have logic which applies a class if the row id is selected (selectedId is stored in Redux state):
 getRowClassName: (params: GridRowClassNameParams<SearchWorksHit>) =>
            params.id === selectedId ? 'Mui-selected' : '',
  1. I navigate forwards and render the next set of results, rows with ids: [4,5,6] with a new selected id ("4")

  2. I navigate back to the initially rendered results list (i.e. ids: [1,2,3]) and encounter "No row with id 4", "No row with id 5" error for every row that was rendered.

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.

@arminmeh arminmeh reopened this Mar 24, 2025
@arminmeh
Copy link
Contributor

arminmeh commented Mar 24, 2025

@nicolasfripp
I have worked on a similar issue and fixed it with #17057

Since there is no reproduction demo for your issue, can you try using this patched version of the data grid
https://pkg.csb.dev/mui/mui-x/commit/7cd30dad/@mui/x-data-grid
and report back if it fixes your problem?

In that case, we can close #16672

@arminmeh arminmeh added the status: waiting for author Issue with insufficient information label Mar 25, 2025
@nicolasfripp
Copy link
Author

@arminmeh I have not been able to reproduce the issue again. I would close the issue but maybe someone else is still facing it. Many things have changed in our system since I opened this issue.

@annabelhayes Can you still reproduce it?

@annabelhayes
Copy link

Nope, I can't reproduce the issue either using the patched version. Thanks!

@Abrham007
Copy link

Abrham007 commented Mar 25, 2025

@arminmeh so I had an issue open here that had a reproducible example for the bug. that issue is now closed mentioning this PR as the reason. but when I tried the latest patch in our code base I can still reproduce the issue.

@jakeleventhal
Copy link

@arminmeh so I had an issue open here that had a reproducible example for the bug. that issue is now closed mentioning this PR as the reason. but when I tried the latest patch in our code base I can still reproduce the issue.

Had this issue as well. We should keep this issue open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet