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.

3.11.x crashes when using config without `default` project

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

Upgrading from 3.10.7 to 3.11.0 and 3.11.1 causes a crash on startup in our project, as we do not have a default project configured.

To Reproduce

Our schema does not contain a default projects - each of our projects are explicitly named.

#1156 introduced a call to graphQLConfig().getDefault() which will throw.

For example, running yarn lint throws an error on initialisation:

ESLint: 8.23.1

[ProjectNotFoundError: Failed to load plugin '@graphql-eslint' declared in '.eslintrc.json#overrides[2]': Project 'default' not found
Referenced from: /path/to/.eslintrc.json] {
  name: 'ProjectNotFoundError',
  message: "Failed to load plugin '@graphql-eslint' declared in '.eslintrc.json#overrides[2]': Project 'default' not found\n" +
    'Referenced from: /path/to/.eslintrc.json'
}
error Command failed with exit code 2.

It looks like the code expects to gracefully handle this as an optional, but getDefault() will never return an optional.

I believe the fix should use getProjectForFile(), to ensure the configuration is associated with the correct project.

Expected behavior

Running yarn lint should work as 3.10.7 did.

Environment:

  • OS: macOS 12.6
  • @graphql-eslint/eslint-plugin: 3.11.1
  • Node.js: v16.14.2

Additional context

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
B2o5Tcommented, Sep 26, 2022

Amazing! thank you for the quick feedback, will be released now 😜

1reaction
B2o5Tcommented, Sep 26, 2022

@notjosh 3.11.2-alpha-20220926144959-f269795 should be good 😃)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dosbox-x crashes while starting Windows for Workgroups ...
Describe the bug Dosbox-x crashes if I start WfW 3.11 with the built in SVGA driver. Switching back to the VGA driver works....
Read more >
Cassandra 3.11 crashing on Windows 10 when started by ...
I'm using cassandra-maven-plugin 3.7. I tried moving the project to Java 11. After adding Java 11 vm options to cassandra-maven-plugin : <plugin> ...
Read more >
Visual Studio 2019 constantly crashing - Microsoft Q&A
Visual Studio 2019 constantly crashing. Hi. I'm at my wit's end with this. I've used VS2017 for years, it was mostly solid.
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
systemPrefs with at least two files" status:RESOLVED resolution:OBSOLETE severity:normal ... Bug:218620 - "Default config: enable CONFIG_SCSI_MULTI_LUN for ...
Read more >
Unity editor crashes macOS
I am using Unity 2019.3.0b1 on a Macbook pro (mid 2015). When editor tries to open after importing the assets from an existing...
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