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

@graphql-codegen/cli is missing tslib dependency #8075

Closed
mhassan1 opened this issue Jul 11, 2022 · 3 comments
Closed

@graphql-codegen/cli is missing tslib dependency #8075

mhassan1 opened this issue Jul 11, 2022 · 3 comments
Assignees
Labels
stage/6-released The issue has been solved on a released version of the library

Comments

@mhassan1
Copy link

mhassan1 commented Jul 11, 2022

Describe the bug

@graphql-codegen/cli is missing an explicit tslib runtime dependency. Running yarn graphql-codegen ... in a strict environment like Yarn Plug'n'Play leads to:

Error: @graphql-codegen/cli tried to access tslib, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

This is an issue in @graphql-codegen/cli@2.8.0, but not @graphql-codegen/cli@2.7.0.

Your Example Website or App

n/a

Steps to Reproduce the Bug or Issue

  1. yarn set version berry
  2. yarn add --dev @graphql-codegen/cli@2.8.0
  3. yarn graphql-codegen ...
  4. Error: @graphql-codegen/cli tried to access tslib, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Expected behavior

Successful command execution

Screenshots or Videos

No response

Platform

  • OS: MacOS
  • NodeJS: 16.14.2
  • graphql version: 16.5.0
  • @graphql-codegen/* version(s): 2.8.0

Codegen Config File

schema: "./schema.gql"
generates:
  "./types.ts":
    plugins: ["typescript"]
    config:
      enumsAsTypes: true

Additional context

I am using the following workaround:

# .yarnrc.yml

packageExtensions:
  "@graphql-codegen/cli@^2":
    dependencies:
      tslib: ~2.4.0
@saihaj saihaj self-assigned this Jul 11, 2022
@saihaj
Copy link
Collaborator

saihaj commented Jul 11, 2022

hey @mhassan1 you can try alpha release and provide feedback

@mhassan1
Copy link
Author

Works for me!

@saihaj saihaj added the stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested label Jul 11, 2022
@saihaj
Copy link
Collaborator

saihaj commented Jul 13, 2022

@saihaj saihaj closed this as completed Jul 13, 2022
@saihaj saihaj added stage/6-released The issue has been solved on a released version of the library and removed stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested labels Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/6-released The issue has been solved on a released version of the library
Projects
None yet
Development

No branches or pull requests

2 participants