Skip to content

[4.0.0-alpha.2] Error doesn't match any project with a .js config file #2464

@lukpsaxo

Description

@lukpsaxo

I've worked around the issue by changing my config to a json, but I spent alot of time debugging this so I will try to help others.

the eslint plugin calls graphql configs loadConfigSync method with a root directory.

graphql config uses cosmiconfig - it uses a createCosmiConfigSync which uses the sync methods of createCosmiConfig and it correctly finds the file synchronously. However in prepareCosmiconfig it uses the default loader for js rather than the js sync loader. So js files get loaded async and a promise gets set as the config passed to graphql-config constructor, meaning no valid projects are found, which then results in the eslint package giving an error.

It seems 100% a bug in graphql-config so I raised a bug there, but since no-one seems to have found it, wanted to point it out here as we didn't get it until upgrading the plugin: graphql-hive/graphql-config#1454

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug :-(stage/6-releasedThe issue has been solved on a released version of the libraryupstreamAn issue that occurs in software related to the chain

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions