jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.98k stars 2.77k forks source link

Cannot read property 'length' of undefined #2553

Closed Abbas645 closed 2 years ago

Abbas645 commented 4 years ago

Hello. I am using eslint 6.8.0 and eslint-plugin-react 7.18.0 and get error 'Cannot read property 'length' of undefined'.

I feel that is related to this lines, because when i delete these, the error will be solved.

for(let i = 0; i < childsTitle.length; i++){
      if(typeOfCells !== 'unknown') {
        childes.push(
          ElementManager.createElement(typeOfCells, [], nameOfFormule + '_' + CaptionHelper.getCaption(childsTitle[i]))
        );
      } else {
        const frame = ElementManager.createElement('frame', [], CaptionHelper.getCaption('frame') + ++ElementExplorerAndVariablesManager.frameCounter);
        childes.push(
          ElementManager.createElement('container', [frame], nameOfFormule + '_' + CaptionHelper.getCaption(childsTitle[i]) )
        );
      }
    }

I don't think that is related to other similar issues that discussed on #854 or #2257

ljharb commented 4 years ago

What’s the stack trace of the error? In particular, which rule is erroring?

ljharb commented 2 years ago

Closing pending more info and the ability to reproduce the failure.