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.

Preprocessing error on invalid files

See original GitHub issue

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

Please make sure the graphql-eslint version under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug When typing in new code in a file makes it temporarily invalid Javascript/Typescript, IntelliJ will show an error banner with “ESLint: Preprocessing error”. This only happens with this plugin enabled, and stops happening if I add a try/catch block in the preprocessor in https://github.com/B2o5T/graphql-eslint/blob/fffb1273f5eda8e3ff3ff15da52202c02be19639/packages/plugin/src/processor.ts#L14

To Reproduce

  1. Configure a project to use Eslint and this plugin.
  2. Open a file in that project that has syntax errors in IntelliJ.

Expected behavior No error banner should be shown, similar to how other plugins handle invalid files.

Environment:

  • OS: Windows 10
  • @graphql-eslint/eslint-plugin: 3.10.7
  • eslint: 8.23.1
  • Node.js: 16.13.2
  • IntelliJ: 2022.2.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Lugribosskcommented, Sep 26, 2022

Awesome, thank you for the fix!

And I think it makes sense to see the error in the terminal, since you run that when you want to know about errors. While the banner shows up when you’re in the middle of editing a file.

0reactions
B2o5Tcommented, Sep 26, 2022

I guess we can back try/catch statement, so the annoying popup in WebStrom will disappear, anyway ESLint will report about the problem while running eslint in terminal

before

image

after

image

fixed in @graphql-eslint/eslint-plugin@3.11.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the error "invalid preprocessing directive"?
I tried to compile a demo code that related to memory access. And i got error message like this: ../nvm.c:444:2: error: invalid preprocessing ......
Read more >
Preprocessing invalid file fails to display errors #3971 - GitHub
The command should print an error message to stderror or stdout. Actual behavior. No output is printed at all. The output file is...
Read more >
"error: invalid preprocessing directive #DEFINE"
2:2: error: invalid preprocessing directive #DEFINE. Why, and how do i fix it? ... Somehow you must have got a c source file...
Read more >
iOS .pch file fetch a error: "Invalid preprocessing directive"
"Invalid preprocessing directive" is just another fancy way of saying "syntax" (or spelling) error. Share. Share a link to this answer.
Read more >
Preprocessing Error - Simulation Run in Infoworks ICM
Preprocessing Error When Attempting to Run a Simulation in InfoWorks ICM · Right click on the InfoWorks ICM Agent service and click 'Properties'....
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