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

Maximum call stack size exceeded #9331

Closed
aschonfeld opened this issue Sep 20, 2017 · 1 comment
Closed

Maximum call stack size exceeded #9331

aschonfeld opened this issue Sep 20, 2017 · 1 comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Comments

@aschonfeld
Copy link

aschonfeld commented Sep 20, 2017

Tell us about your environment

  • ESLint Version:
    ^4.7.0
  • Node Version:
    6.4.0
  • npm Version:
    3.10.1

Please show your full configuration:

Configuration
{
    "env": {
        "browser": true,
        "node": true
    },
    "globals": {
        "Promise": true
    },
    "parserOptions": {
        "ecmaVersion": 6,
        "ecmaFeatures": {
            "jsx": true,
            "impliedStrict": true
        },
        "sourceType": "module"
    },
    "rules": {
        "arrow-body-style": ["error", "as-needed"],
        "block-scoped-var": "error",
        "camelcase": ["error", {"properties": "never"}],
        "complexity": "error",
        "consistent-this": ["error", "me"],
        "consistent-return": "error",
        "curly": "error",
        "dot-notation": "error",
        "lodash/chaining": "off",
        "lodash/import-scope": "off",
        "lodash/prefer-constant": "off",
        "lodash/prefer-includes": "error",
        "lodash/prefer-lodash-chain": "off",
        "lodash/prefer-lodash-method": "off",
        "lodash/path-style": ["error", "as-needed"],
        "max-len": ["error", {"code": 120}],
        "max-lines": ["error", 300],
        "max-params": ["error", 8],
        "max-statements": ["error", 25],
        "max-statements-per-line": ["error", {"max": 2}],
        "new-cap": "error",
        "no-alert": "error",
        "no-console": ["error", {"allow": ["error"]}],
        "no-constant-condition": ["error", {"checkLoops": false}],
        "no-eq-null": "error",
        "no-eval": "error",
        "no-extra-label": "error",
        "no-extra-bind": "error",
        "no-extend-native": "error",
        "no-fallthrough": "error",
        "no-invalid-this": "error",
        "no-lone-blocks": "error",
        "no-lonely-if": "error",
        "no-mixed-spaces-and-tabs": "off",
        "no-negated-condition": "error",
        "no-return-assign": "error",
        "no-restricted-globals": ["error", "fetch", "self", "module"],
        "no-self-compare": "error",
        "no-sequences": "error",
        "no-unused-expressions": "error",
        "no-unused-vars": ["error", {"args": "all", "argsIgnorePattern": "^_"}],
        "no-useless-computed-key": "error",
        "no-useless-escape": "error",
        "no-use-before-define": "error",
        "no-unreachable": "error",
        "no-useless-call": "error",
        "no-useless-concat": "error",
        "no-void": "error",
        "no-with": "error",
        "prefer-const": ["error", {"destructuring": "all"}],
        "prefer-rest-params": "error",
        "prefer-spread": "error",
        "prettier/prettier": ["error", {"trailingComma": "es5", "printWidth": 120, "jsxBracketSameLine": true}],
        "promise/catch-or-return": "error",
        "react/no-unused-prop-types": "error",
        "react/jsx-key": "error",
        "strict": "error",
        "tape/no-ignored-test-files": ["error", {"files": ["static/__tests__/**/*test.js", "static/__tests__/**/*test.jsx"]}]
    },
    "plugins": [
        "lodash",
        "promise",
        "react",
        "tape",
        "prettier"
    ],
    "extends": [
        "eslint:recommended",
        "plugin:lodash/recommended",
        "plugin:react/recommended",
        "plugin:tape/recommended",
        "prettier"
    ]
}

What did you do? Please include the actual source code causing the issue.

I tried to run the following command (which worked up until eslint@4.6.1):

npm run eslint static *.js --ext .js --ext .jsx -f node_modules/eslint-clang-formatter

What actually happened? Please include the actual, raw output from ESLint.
The command fails with this exception:

Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at cloneOf (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:54:22)
at cloneObject (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:49: 26)
at cloneNodeOrObject (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast. js:21:20)
at cloneOf (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:61:24)
at cloneObject (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:49: 26)
at cloneNodeOrObject (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast. js:21:20)
at cloneOf (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:61:24)
at cloneObject (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:49: 26)
at cloneNodeOrObject (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast. js:21:20)
at cloneOf (/NImounts/NiNoSnapUsers/aschonfeld/dev/git/grail/node_modules/espurify/lib/clone-ast.js:61:24)

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 20, 2017
@not-an-aardvark not-an-aardvark added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Sep 20, 2017
@not-an-aardvark
Copy link
Member

This is probably happening as a result of 1488b51. It looks like a rule was relying on cloning the AST when it was created, and it didn't use proper loop detection, so it's now causing an error because the AST is always circular since it has parent properties at the start.

Maybe we should revert 1488b51 and reintroduce it in a major release.

not-an-aardvark added a commit that referenced this issue Sep 20, 2017
This reverts commit 1488b51. Some rules
from plugins were relying on the behavior that a a `node.parent`
property is only sometines present, and other rules were relying on the
behavior that the AST contains no cycles when rules are created.
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 20, 2017
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 21, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

3 participants