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

Package has been ignored because it contains invalid configuration. #840

Closed
stelmakhivan opened this issue Dec 13, 2021 · 10 comments
Closed
Labels
kind/bug Bug :-(

Comments

@stelmakhivan
Copy link
Contributor

After updating to latest versions I've been getting the following warning on app startup:

warn Package @graphql-codegen/cli has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/cli/package.json.js'
warn Package @graphql-codegen/fragment-matcher has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/fragment-matcher/package.json.js'
warn Package @graphql-codegen/introspection has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/introspection/package.json.js'
warn Package @graphql-codegen/typescript has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/typescript/package.json.js'
warn Package @graphql-codegen/typescript-document-nodes has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/typescript-document-nodes/package.json.js'
warn Package @graphql-codegen/typescript-graphql-files-modules has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/typescript-graphql-files-modules/package.json.js'
warn Package @graphql-codegen/typescript-graphql-request has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/typescript-graphql-request/package.json.js'
warn Package @graphql-codegen/typescript-operations has been ignored because it contains invalid configuration. Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/typescript-operations/package.json.js'

I haven't changed anything related to GraphQL Codegen. I'm on TypeScript 4.4.2, and here is the relevant part of my DEV dependencies:

"devDependencies": {
	...
    "@graphql-codegen/cli": "2.1.1",
    "@graphql-codegen/fragment-matcher": "3.1.0",
    "@graphql-codegen/introspection": "2.1.0",
    "@graphql-codegen/typescript": "2.1.2",
    "@graphql-codegen/typescript-document-nodes": "2.1.2",
    "@graphql-codegen/typescript-graphql-files-modules": "2.1.0",
    "@graphql-codegen/typescript-graphql-request": "^4.1.2",
    "@graphql-codegen/typescript-operations": "2.1.2",
	...
  }

To Reproduce
Have the latest versions of GraphQL codegen for TypeScript in your dev dependencies, run your app, check console.

Expected behavior
The warning shouldn't display.

Environment:

OS: macOS 11.3.1
@graphql-codegen/...: See above
NodeJS: 14.17.2
Additional context
This wasn't the case before updating to latest versions. Note that this is a minor annoyance, not a breaking bug or anything. Everything still work as expected otherwise.

@dotansimha
Copy link
Collaborator

Great catch, thanks @stelmakhivan !

@dotansimha dotansimha added kind/bug Bug :-( stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested labels Dec 14, 2021
@dotansimha
Copy link
Collaborator

Fixed in @graphql-eslint/eslint-plugin@3.2.0. Thanks @stelmakhivan

@stelmakhivan
Copy link
Contributor Author

@dotansimha, I have just installed the latest version of the @graphql-eslint package and I don't see "./package.json": "./package.json" in node_modules/@graphql-eslint/eslint-plugin/package.json

Screenshot 2021-12-14 at 21 37 25

@dotansimha dotansimha reopened this Dec 14, 2021
@dotansimha
Copy link
Collaborator

Thanks @stelmakhivan
@kamilkisiela @ardatan i think it's an issue with bob maybe?

@dotansimha dotansimha removed the stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested label Dec 14, 2021
@kamilkisiela
Copy link
Collaborator

Reason: Cannot find module '/path/to/my/app/node_modules/@graphql-codegen/fragment-matcher/package.json.js'

.json.js, probably require. I don't think it's related to bob

@stelmakhivan
Copy link
Contributor Author

stelmakhivan commented Dec 14, 2021

@kamilkisiela, @dotansimha When I add "./package.json": "./package.json" manually (see this comment dotansimha/graphql-code-generator#6599 (comment)) then warnings are fixed

I am using react native in my project.

But after I install the latest version of @graphql-eslint, "./package.json": "./package.json" is missed in exports even if I have this line already in code (see https://github.com/dotansimha/graphql-eslint/blob/master/packages/plugin/package.json#L11)

It works perfectly with other libraries, like these:
react-hook-form
zora
effector
react-final-table

@kamilkisiela
Copy link
Collaborator

lol, didn't know you need to put package.json in package.json to import/require package.json :D

@kamilkisiela
Copy link
Collaborator

so yeah, it gets lost at some point

@stelmakhivan
Copy link
Contributor Author

lol, didn't know you need to put package.json in package.json to import/require package.json :D

react-native-community/cli#1168

@dimaMachina
Copy link
Owner

Fixed in 3.3.0 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug :-(
Projects
None yet
Development

No branches or pull requests

4 participants