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

Getting "TypeError: Cannot read properties of undefined (reading 'id')" in production build #1327

Open
1 task done
TheEsquel opened this issue Dec 13, 2024 · 0 comments
Open
1 task done

Comments

@TheEsquel
Copy link

material-react-table version

3.0.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

This error occurs when typing a value in any column filter or global filter. When trying to clean the value with the cross the error becomes uncaught and the app crashes.
Im using yarn and material-react-table works just perfect, the error only occurs in dev mode with yarn build and then serve -s build. yarn scripts launches regular react-scripts build

the full error message is

getFilteredRowModel.ts:94 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at n (getFilteredRowModel.ts:94:46)
    at b (getFilteredRowModel.ts:92:66)
    at getFilteredRowModel.ts:86:58
    at Object._getFilteredRowModel (utils.ts:167:16)
    at e.getFilteredRowModel (ColumnFiltering.ts:412:20)
    at e.getPreGroupedRowModel (ColumnGrouping.ts:344:47)
    at e.getGroupedRowModel (ColumnGrouping.ts:351:22)
    at e.getPreSortedRowModel (RowSorting.ts:529:46)
    at getSortedRowModel.ts:10:46
    at Object._getSortedRowModel (utils.ts:152:21)

It happens even with the example data and columns from the documentations so I assume it has nothing to do with the project or data structure.

the other lib versions are:
"react-dom": "18.2.0",
"typescript": "^5.1.6"

Minimal, Reproducible Example - (Optional, but Recommended)

I now simplified it to the standard example, so

const table = useMaterialReactTable({
columns,
data, //must be memoized or stable (useState, useMemo, defined outside of this component, etc.)
enableRowSelection: true, //enable some features
enableColumnOrdering: true, //enable a feature for all columns
enableGlobalFilter: false, //turn off a feature
});

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant