material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Material Table freezes Browser

Open Sandy2691 opened this issue 6 years ago • 38 comments

Guidelines

  • Please include a demo of the issue/behavior/question you have

  • Please try to be as detailed as possible

  • You may fork one of the following starter templates if you would like:

Describe the bug A clear and concise description of what the bug is. Material Table freezes the screen when trying to reload new data. I have an input field and making a service call with that input field and adding the new data to the state(state contains the data supplied to the table). And also for every change in input value Material table is rerendered and it's slowing down the page

To Reproduce Steps to reproduce the behavior:

  1. Enter value in input field
  2. Enter search button(Make a service call and update state with newdata)
  3. For the 2nd search the browser is becoming slow
  4. For the 3rd search the browser completely becomes unresponsive

Expected behavior A clear and concise description of what you expected to happen. Material Table should not freeze the screen Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

OS: windows server 2016 standard(64 bit), Browser:Chrome Version:85.0.4183.102

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here. Using Materiaa Table version 1.62.0

Sandy2691 avatar Sep 12 '20 10:09 Sandy2691

please refer to my previous issue Poor performance. Page gets unresponsive #2433 I found the same problem so as a few others. Till this is resolved, I've moved back to core material-ui table

DewangS avatar Sep 13 '20 01:09 DewangS

Downgraded the package to 1.61.0 and the issue is resolved.

Sandy2691 avatar Sep 15 '20 06:09 Sandy2691

Also linked #2418 and potentially #2425

There seems to be a large json object called tableData added to the column data:

https://github.com/mbrn/material-table/issues/2433#issuecomment-690290099

Possibly this has cyclic references, objects are not immutably recreated and parsing enters an infinite loop / memory leak

arelra avatar Sep 15 '20 17:09 arelra

as per someone else it's pretty stable anything below v.1.67.0

DewangS avatar Sep 15 '20 22:09 DewangS

+1 on this issue. Works well when downgrading to 1.67.0

jonassvalin avatar Sep 18 '20 08:09 jonassvalin

This just saved me hours of debugging...Thanks! +1.

tybeck avatar Sep 21 '20 15:09 tybeck

v1.68.0 works fine for me. Browser freeze occurs when I use v1.68.1 + the jspdf warning.

sujay-gandham-by avatar Sep 21 '20 15:09 sujay-gandham-by

please refer to my previous issue Poor performance. Page gets unresponsive #2433 I found the same problem so as a few others. Till this is resolved, I've moved back to core material-ui table

As much as i like mbrn/material-table i'm also done with it for now. Will also move back to core material-ui table. Recently this library is giving me nothing but work and problems, and unfortunately pull requests take an eternity to be merged and released to a new version :(

Downgrading is a pretty bad option considering the bugs previous versions had

Btw: I'm starting a new leightweight side- project based on core-material-table (which can be just copied). Check it out its still early stage though and supports only a few features: https://github.com/masbaehr/core-material-table . Ultimately the goal is to replace with when advanced features of are not required!

masbaehr avatar Sep 21 '20 16:09 masbaehr

use v.1.67.0

nightwolf-041 avatar Sep 23 '20 10:09 nightwolf-041

Downgraded the package to 1.61.0 and the issue is resolved.

It works properly in the 1.67.0

nightwolf-041 avatar Sep 23 '20 10:09 nightwolf-041

I don't really understand. when I put column as a variable and put it outside the react component. my browser always hangs

const COLUMNS = [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
const myTable = () => {
 <MaterialTable
      columns={COLUMNS}
      ...
   />

but if I put it directly in the props column it works fine, I'm using version v.1.69.0

 <MaterialTable
      columns={ [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
 ...
/>

ilhamsa1 avatar Sep 25 '20 16:09 ilhamsa1

also experiencing this issue when columns are passed to the material-table as props from a parent component. downgrading to 1.67 has resolve the issue for now.

saunlani avatar Oct 02 '20 13:10 saunlani

I have 2 routed pages which both contains a material-table, when I switch the 2 pages back and forth by clicking route link, the browser freezes.

Version: 1.69.0 OS: Mac Catalina Chrome: v85.0.4183.121

swiftech avatar Oct 04 '20 03:10 swiftech

I have 2 routed pages which both contains a material-table, when I switch the 2 pages back and forth by clicking route link, the browser freezes.

Same on my side with 1.69.1

chrisbag avatar Oct 14 '20 17:10 chrisbag

I don't really understand. when I put column as a variable and put it outside the react component. my browser always hangs

const COLUMNS = [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
const myTable = () => {
 <MaterialTable
      columns={COLUMNS}
      ...
   />

but if I put it directly in the props column it works fine, I'm using version v.1.69.0

 <MaterialTable
      columns={ [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
 ...
/>

This fixed the freezing issue for me.

I have custom filters for data which causes the table to re-render and after few changes to the table the browser tab starts to slow and eventually freeze/crash.

samje avatar Oct 26 '20 07:10 samje

but if I put it directly in the props column it works fine, I'm using version v.1.69.0

 <MaterialTable
      columns={ [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
 ...
/>

this works but it's not optimal :)

alexdobsom avatar Nov 10 '20 23:11 alexdobsom

I don't really understand. when I put column as a variable and put it outside the react component. my browser always hangs

const COLUMNS = [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
const myTable = () => {
 <MaterialTable
      columns={COLUMNS}
      ...
   />

but if I put it directly in the props column it works fine, I'm using version v.1.69.0

 <MaterialTable
      columns={ [
  {
    title: 'Name',
    field: 'name',
  },
{
    title: 'test',
    field: 'test',
  },
}]
 ...
/>

This works for me as well, but it's weird, I'm not sure why this has anything to do with the issue! the only difference that I can see is the constant (COLUMNS) is declared outside material-table scope.

yassinejebli avatar Nov 27 '20 11:11 yassinejebli

It still freezes even when I downgrade to 1.67.0. It works only if I declare columns directly inside the component

AnimeshTimsina avatar Nov 29 '20 04:11 AnimeshTimsina

I was able to narrow this down to PR #2351 by testing using a binary git commit search. That commit is between 1.68.1 and 1.69.0, the first one post-1.68.1. There are many changes in that commit, and I'll need to isolate it further.

image

peacechen avatar Dec 10 '20 23:12 peacechen

@AnimeshTimsina

That's odd. Mine works fine with 1.67.0 having column declaration separate as an array.

DewangS avatar Dec 10 '20 23:12 DewangS