question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError: Maximum call stack size exceeded from `scope-manager`

See original GitHub issue

Ported over, per request from https://github.com/yannickcr/eslint-plugin-react/issues/1571

Tell us about your environment

  • ESLint Version: 4.11.0
  • Node Version: 8.1.4
  • npm Version: 5.0.3

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

Configuration
root: true
# have to include `plugin:react/recommended` to avoid errors
extends:
  - eslint:all
  - plugin:eslint-plugin-jsx-a11y/recommended
  - plugin:fp/recommended
  - plugin:import/errors
  - plugin:react/all
plugins: [eslint-plugin-jsx-a11y, fp, import, react]
parserOptions:
  sourceType: module
  ecmaVersion: 2017
  ecmaFeatures:
    jsx: true
    experimentalObjectRestSpread: true
env:
  browser: true
  es6: true
  node: true
globals:
  $: true
settings:
  import/resolver:
    node:
      moduleDirectory: [app/javascript, node_modules, spec/javascript]
rules:
  ### to enable/improve
  class-methods-use-this: off
  fp/no-class: off
  fp/no-delete: off
  fp/no-let: off
  fp/no-loops: off
  fp/no-mutating-methods: off
  fp/no-mutation: off
  fp/no-nil: off
  fp/no-rest-parameters: off
  fp/no-this: off
  fp/no-throw: off
  fp/no-unused-expression: off
  init-declarations: off
  jsx-a11y/anchor-is-valid: off
  jsx-a11y/click-events-have-key-events: off
  jsx-a11y/href-no-hash: off
  jsx-a11y/label-has-for: off
  jsx-a11y/no-onchange: off
  jsx-a11y/no-static-element-interactions: off
  jsx-a11y/onclick-has-role: off
  max-len: [error, 112]
  max-statements: [error, { max: 14 }]
  multiline-comment-style: off
  no-magic-numbers: off
  react/forbid-component-props: off
  react/forbid-prop-types: off
  # https://github.com/yannickcr/eslint-plugin-react/issues/1449
  react/jsx-curly-brace-presence: off
  react/jsx-sort-props: off
  react/no-set-state: off
  # https://github.com/yannickcr/eslint-plugin-react/issues/811
  react/no-unused-prop-types: off
  react/prefer-es6-class: off
  react/require-default-props: off
  react/require-optimization: off
  sort-imports: off # https://github.com/eslint/eslint/issues/7766
  sort-keys: off

  ### departures from default
  brace-style: [error, 1tbs, { allowSingleLine: true }]
  comma-dangle: [error, always-multiline]
  func-style: [error, declaration]
  function-paren-newline: [error, consistent]
  id-length: [error, { exceptions: [_, $] }]
  indent: [error, 2]
  jsx-quotes: [error, prefer-single]
  max-statements-per-line: [error, { max: 2 }]
  multiline-ternary: [error, never]
  newline-per-chained-call: [error, { ignoreChainWithDepth: 3 }]
  no-extra-parens: [error, all, { nestedBinaryExpressions: false, ignoreJSX: 'multi-line' }]
  no-multiple-empty-lines: [error, { max: 1, maxEOF: 0, maxBOF: 0 }]
  no-underscore-dangle: [error, { allowAfterThis: true }]
  object-property-newline: [error, { allowMultiplePropertiesPerLine: true }]
  one-var: [error, never]
  padded-blocks: [error, never]
  prefer-arrow-callback: [error, { allowNamedFunctions: true }]
  prefer-destructuring: [error, { array: false }]
  quote-props: [error, as-needed, { keywords: true }]
  quotes: [error, single]
  react/jsx-indent-props: [error, 2]
  react/jsx-indent: [error, 2]
  react/jsx-wrap-multilines: [error, { declaration: false }]
  space-before-function-paren: [error, { anonymous: always, named: never }]
  spaced-comment: [error, always, { markers: [=] }]

  ### disabled for good
  array-element-newline: off
  capitalized-comments: off
  jsx-a11y/no-autofocus: off
  line-comment-position: off
  no-inline-comments: off
  no-ternary: off
  react/jsx-filename-extension: off
  react/jsx-handler-names: off
  react/jsx-max-props-per-line: off
  require-jsdoc: off

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

I made a typo in one of my tests, and got a weird RangeError from ESLint.

const props = {...props, scratch: {mode: 'edit'}};
const component = shallow(<TaskEditableTitle {...props} />);
./node_modules/eslint/bin/eslint.js ./ --ext .js,.jsx --cache

What did you expect to happen?

Some complaint about invalid syntax, or maybe a rule violation if it is technically valid syntax. (Doesn’t appear to be…)

What actually happened? Please include the actual, raw output from ESLint.

Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at ScopeManager.__get (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-scope/lib/scope-manager.js:85:10)
    at ScopeManager.acquire (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-scope/lib/scope-manager.js:127:29)
    at getScope (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint/lib/linter.js:613:36)
    at Object.getScope (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint/lib/linter.js:843:37)
    at Object.variablesInScope (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/util/variable.js:36:23)
    at findSpreadVariable (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:23:27)
    at node.properties.find.prop (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:38:28)
    at Array.find (native)
    at findObjectProp (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:34:30)
    at node.properties.find.prop (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:40:20)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
not-an-aardvarkcommented, Jan 19, 2018

Closing because this doesn’t seem to be an issue with ESLint core.

0reactions
mysticateacommented, Nov 29, 2017

@ljharb Yes. I guessed the cause of confusion is that the stack trace didn’t show actual recursive calls because context.getScope() has deep depth calling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angularjs - RangeError: Maximum call stack size exceeded
It's because you're comparing for object for equality rather than for reference. Change your $watch statement to this: $scope.$watch("options.map", function ...
Read more >
RangeError: Maximum call stack size exceeded? - Codecademy
It means you have accidentally stumbled upon a recursive function that has no base case by which to exit. The program will be...
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >
"RangeError: Maximum call stack size exceeded" Why?
JavaScript : " RangeError : Maximum call stack size exceeded " Why? [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >
Maximum call stack size exceeded Error - Mendix Forum
Hi Mohan,. You error message is created by mxui.js this is the browser client (JavaScript). Java actions and Microflow are server side.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found