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.

TypeError: state.popChainContext is not a function

See original GitHub issue
> eslint .


Oops! Something went wrong! :(

ESLint: 7.19.0

TypeError: state.popChainContext is not a function
Occurred while linting C:\Users\aminy\atom-ide\nuclide\nuclide-commons\fsPromise.js:345
    at processCodePathToExit (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\code-path-analysis\code-path-analyzer.js:512:19)
    at CodePathAnalyzer.leaveNode (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\code-path-analysis\code-path-analyzer.js:729:9)
    at CodePathAnalyzer.overrideLeaveNode (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint-plugin-node@11.1.0_eslint@7.19.0\node_modules\eslint-plugin-node\lib\rules\process-exit-as-throw.js:130:27)
    at C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\linter.js:954:32
    at Array.forEach (<anonymous>:null:null)
    at runRules (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\linter.js:947:15)
    at Linter._verifyWithoutProcessors (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\linter.js:1173:31)
    at Linter._verifyWithConfigArray (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\linter.js:1271:21)
    at Linter.verify (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\linter.js:1226:25)
    at LinterPrototype.verify (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint-plugin-only-warn@1.0.2\node_modules\eslint-plugin-only-warn\src\only-warn.js:14:55)
    at Linter.verifyAndFix (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\linter\linter.js:1416:29)
    at verifyText (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\cli-engine\cli-engine.js:239:48)
    at CLIEngine.executeOnFiles (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\cli-engine\cli-engine.js:807:28)
    at ESLint.lintFiles (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\eslint\eslint.js:521:23)
    at Object.execute (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\lib\cli.js:294:36)
    at main (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\bin\eslint.js:142:52)
    at Object.<anonymous> (C:\Users\aminy\atom-ide\node_modules\.pnpm\eslint@7.19.0\node_modules\eslint\bin\eslint.js:146:2)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47

Tell us about your environment

  • ESLint Version: 7.19.0
  • Node Version: 15.8.0
  • npm Version: 6.14.11

What parser (default, @babel/eslint-parser, @typescript-eslint/parser, etc.) are you using?

I am using eslint-config-atomic which uses babel-eslint

Please show your full configuration:

Configuration
{
  "extends": "eslint-config-atomic",
  "ignorePatterns": ["dist/", "node_modules/"]
}

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

https://github.com/atom-community/atom-ide-base/blob/8e952b465a6485eee76881cc201108e5bd853668/nuclide/nuclide-commons/fsPromise.js#L345

const mode = typeof options !== 'string' ? options?.mode : null;
eslint .

What did you expect to happen? Lint

What actually happened? Please include the actual, raw output from ESLint. An internal Eslint error happens

Are you willing to submit a pull request to fix this bug? Not sure how to fix it

Mirror: https://github.com/atom-community/atom-ide-base/issues/56

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
helixbasscommented, Feb 9, 2021

Great, I’ll mention when I release a new eslint-plugin-coffee version that includes that fix so that you can update dependencies

If you are using the file extension to dynamically detect CoffeeScript, could you add .cson to the supported extensions too?

It’s detecting CoffeeScript based on AST properties set by eslint-plugin-coffee, so it should also pick up .cson since it appears eslint-config-atomic is already mapping that extension to eslint-plugin-coffee

1reaction
helixbasscommented, Feb 9, 2021

Ok @aminya I took a stab at dynamically restricting the monkeypatching to only “kick in” when linting Coffeescript files, can you try installing this dev version of eslint-plugin-coffee:

yarn add --dev github:helixbass/eslint-plugin-coffee#eslint-plugin-coffee-v0.1.14-dev.1-gitpkg

And let me know if that resolves the issue? If it does, I can bump that version to beta and then release

Also since this isn’t an ESLint issue we can move discussion if that’s preferable, eg I opened https://github.com/helixbass/eslint-plugin-coffee/issues/48

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve this error: TypeError: this.state is not a function
To update state you need to call this.setState. Change this.state({ to this.setState({.
Read more >
TypeError: Object(...) is not a function · Issue #14484 - GitHub
I have created react functional component and implement state full logic using useState method but it throws an TypeError: Object(.
Read more >
TypeError: map() is not a function in React | bobbyhadz
The "TypeError: map is not a function" occurs when we call the map() method on a value that is not an array. To...
Read more >
React Error: "this.setstate is not a function" - How to Fix
"this.setstate is not a function" is a common error message that comes up in React. In this article, we'll learn how to fix...
Read more >
state.map is not a function | react error when accessing state
JS - JavaScript. state.map is not a function | react error when accessing state. 14K views 1 year ago. Sagar S. Sagar S....
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