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

Node must be provided when reporting error if location is not provided #306

Closed
Jaxenormus opened this issue Jun 16, 2020 · 12 comments
Closed

Comments

@Jaxenormus
Copy link

Jaxenormus commented Jun 16, 2020

This happens on random and most of the times the error is not current it also happens top pop up when I'm just typing code

Stack trace

AssertionError [ERR_ASSERTION]: Node must be provided when reporting error if location is not provided
    at assertValidNodeInfo (/usr/local/lib/node_modules/eslint/lib/linter/report-translator.js:98:9)
    at /usr/local/lib/node_modules/eslint/lib/linter/report-translator.js:311:9
    at Object.report (/usr/local/lib/node_modules/eslint/lib/linter/linter.js:917:41)
    at Program (/Users/Caleb/Desktop/Barnabus-development/main-bot/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js:265:23)
    at /usr/local/lib/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/usr/local/lib/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/usr/local/lib/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (/usr/local/lib/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode (/usr/local/lib/node_modules/eslint/lib/linter/node-event-generator.js:297:14)

All my dev dependencies

    "eslint": "^7.2.0",
    "eslint-config-airbnb-base": "^14.2.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.21.2",
    "eslint-plugin-prettier": "^3.1.4",
    "prettier": "^2.0.5"
@iamchathu
Copy link

@CalebDelbridge I'm also having this. What was the fix you have done?

@Jaxenormus
Copy link
Author

In all honesty, I'm not sure. Try restarting vscode, deleting node_modules, reinstalling the dependencies, and checking your config. These are all the things that I think I did, and it resolved itself. Best of luck mate

@basyusuf
Copy link

basyusuf commented Feb 8, 2021

Has anyone found any solution? I am having this problem with files containing enum type

@ChenReuven
Copy link

me also, with enum

@tcamaraCS
Copy link

In my case, I was making use of typescript-eslint and this solved my issue: no-unused-vars override

Detailed info here: typescript-eslint/typescript-eslint#2486

@basyusuf
Copy link

basyusuf commented Mar 3, 2021

Hi @tcamaraCS , thank you 🎉 it solved my problem too but does not change the fact that it is a bug 😎

@Dwn96
Copy link

Dwn96 commented Nov 29, 2021

Currently experiencing this. Has anyone found a fix?

@antonfrolovsky
Copy link

@Dwn96 #306 (comment)

@SergeyKazarinov
Copy link

I had a similar problem. Instead of redefining the rules. I corrected the cause in enum.

BEFORE

export enum CurrencyEnum {
  'RUB' = 'RUB',
  'EUR' = 'EUR',
  'USD' = 'USD',
}

AFTER

export enum CurrencyEnum {
  RUB = 'RUB',
  EUR = 'EUR',
  USD = 'USD',
}

After changing the enum the error is gone

@denis88k
Copy link

I had a similar problem. Instead of redefining the rules. I corrected the cause in enum.

BEFORE

export enum CurrencyEnum {
  'RUB' = 'RUB',
  'EUR' = 'EUR',
  'USD' = 'USD',
}

AFTER

export enum CurrencyEnum {
  RUB = 'RUB',
  EUR = 'EUR',
  USD = 'USD',
}

After changing the enum the error is gone

the fixes helped me too. thank you!)))
мне тоже помогли соответствующие исправления. Спасибо, Сергей!

@heyakyra
Copy link

this doesn't help if the quotations are not redundant (names with dashes or whitespace, etc)

@Jaxenormus why was this closed?

@JounQin
Copy link
Member

JounQin commented Mar 12, 2024

Please don't comment on old issues, intead, you should create a new issue with runnable reproduction if you're still facing the issue.

@prettier prettier locked and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests