Giter Club home page Giter Club logo

Comments (9)

lostplan avatar lostplan commented on May 5, 2024 10

v1.2.2 is released with support for [email protected] peer-dependency. Let me know how you get on.

from graphql-language-service.

lifeiscontent avatar lifeiscontent commented on May 5, 2024 3

welp, I guess GraphQL is dead. Long live SQL 😝

from graphql-language-service.

james-ff avatar james-ff commented on May 5, 2024 1

I'm in dependency hell 3 libraries up from this

from graphql-language-service.

barbalex avatar barbalex commented on May 5, 2024

This is getting very important.

I am getting an increasing number of problems due to different versions of graphql in the codebase.

And most of all: due to an issue in graphql versions before v13 that creates errors when multiple instances of graphql (even the same version) were created, see: https://github.com/graphql/graphql-js/releases/tag/v0.13.0 "Only trigger "one instance of graphql" error in DEV environments, removing false errors from minified bundles".

I am using a resolutions key in package.json to circumvent problems:

"resolutions": {
    "graphql": "0.13.2"
}

npm ls graphql lists in my case:

alexa@DESKTOP-6C4V66Q C:\Users\alexa\ae2
> npm ls graphql
[email protected] C:\Users\alexa\ae2
+-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
|       +-- UNMET DEPENDENCY graphql@^0.12.3
|       `-- [email protected]
|         `-- UNMET DEPENDENCY graphql@^0.12.3
`-- [email protected]
  `-- UNMET DEPENDENCY graphql@>=0.6 <0.13

npm ERR! missing: graphql@^0.12.3, required by [email protected]
npm ERR! missing: graphql@^0.12.3, required by [email protected]
npm ERR! missing: graphql@>=0.6 <0.13, required by [email protected]

Someone else has asked postgraphile to update to graphql v13 but that seems blocked because of codemirror-graphql, which in turn depends on graphql-language-service: graphile/crystal#720.

Seems that [email protected] is one of the reasons graphql v13 can't be used. The up to date version (0.5.0) enables that though: https://github.com/graphcool/graphql-import/blob/master/package.json

So updating graphql-import could help.

Same is true for [email protected] (up to date: v2.0.1): https://github.com/graphcool/graphql-config/blob/master/package.json

from graphql-language-service.

TSMMark avatar TSMMark commented on May 5, 2024

I'm also having problems with multiple versions of graphql. Using webpack, I was able to resolve most of the issues by adding a resolve alias to make sure all modules are using the same graphql module:

resolve: {
  alias: {
    graphql: path.resolve('./node_modules/graphql'),
  },
},

That said, it would be great to get all the graphql/* packages up to date with the latest graphql version. Is there anything I or other community members can do to help?

from graphql-language-service.

lifeiscontent avatar lifeiscontent commented on May 5, 2024

@lostplan can we get an update here?

from graphql-language-service.

james-ff avatar james-ff commented on May 5, 2024

+1

from graphql-language-service.

TSMMark avatar TSMMark commented on May 5, 2024

I got so tired of NPM peerDependency hell I wrote this snippet to recursively remove all peerDependency records from all package.json files in node_modules. This is probably a terrible idea but oh well it let me write my shrinkwrap/lockfile sooooo... Enjoy!

https://gist.github.com/TSMMark/5488758028b10d537bf1f721198a539e

const fs = require('fs')

function replaceInFile ({ file, pattern, replacement }) {
  fs.readFile(file, 'utf8', (err, data) => {
    if (err) {
      return console.log(err)
    }

    const result = data.replace(pattern, replacement)

    fs.writeFile(file, result, 'utf8', (err) => {
      if (err) return console.log(err)
    })
  })
}

function removePeerDepsEntry (packageJsonFilePath) {
  replaceInFile({
    file: packageJsonFilePath,
    pattern: /"peerDependencies":[^}]*{[^}]*},/,
    replacement: '',
  })
}

function recursiveClearPeerDeps (dir = 'node_modules') {
  fs.readdir(dir, (err, files) => {
    if (err) {
      console.error('clear-peer-deps Error: ' + err.toString())
    } else {
      files.forEach((file) => {
        const packageJsonFilePath = path.join(dir, file, 'package.json')
        if (fs.existsSync(packageJsonFilePath)) {
          removePeerDepsEntry(packageJsonFilePath)
        }

        const nestedNodeModules = path.join(dir, file, 'node_modules')
        if (fs.existsSync(nestedNodeModules)) {
          recursiveClearPeerDeps(nestedNodeModules)
        }
      })
    }
  })
}

from graphql-language-service.

lifeiscontent avatar lifeiscontent commented on May 5, 2024

@gaearon do you know anyone who could get the ball rolling on this issue?

from graphql-language-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.