Code Monkey home page Code Monkey logo

Comments (26)

asiandrummer avatar asiandrummer commented on May 5, 2024 4

@tsunammis I meant to look into this issue, but had been sidetracked to work on other things meanwhile. I promise I'll deal with this and release a new patch version by this week. Sorry for the delay.

from graphql-language-service.

danez avatar danez commented on May 5, 2024 4

As a workaround one can exclude *.flow files from being process by webpack, by adding this plugin:

// Only consider js files for the context
new webpack.ContextReplacementPlugin(/graphql-language-service-interface[\/\\]dist/, /\.js$/),

The warning will still be there, but at least it works.

from graphql-language-service.

asiandrummer avatar asiandrummer commented on May 5, 2024 4

Finally came around this! I'll cut a new release soon, and update codemirror-graphql and graphiql accordingly as well.

from graphql-language-service.

gpoitch avatar gpoitch commented on May 5, 2024 4

It's pulling the latest version now. There are a bunch of new warnings with .flow files now. Original warning I reported is gone.

from graphql-language-service.

danez avatar danez commented on May 5, 2024 2

The problem is also, that the dynamic require makes webpack pickup all files including *.flow files which cannot be parsed by webpack/acorn and print a warning. Webpack still bundles this files which makes uglify completely fail as it doesn't understand ES6/flow. So for now I had to pin graphiql@^0.9.0 and [email protected] in order to get our application working again.

It is also not a problem of webpack. Webpack will never be able to handle dynamic requires. The dynamic require has to be replaced with something not dynamic in this package or somehow be excluded in codemirror-graphql.

from graphql-language-service.

danez avatar danez commented on May 5, 2024 2

@asiandrummer Yes that should probably make webpack not complain and only include valid files.

Thanks for looking into this.

from graphql-language-service.

gpoitch avatar gpoitch commented on May 5, 2024 2

@asiandrummer thanks for the fix. codemirror-graphql has this dep locked so I'm unable to get the update in the latest graphiql release

https://github.com/graphql/codemirror-graphql/blob/713c092c1ddf4427e134b132e2611d0cbcb15c8e/package.json#L50

from graphql-language-service.

gpoitch avatar gpoitch commented on May 5, 2024 2

I can just explicitly ignore .flow files in my own webpack config and the warnings are gone and all is well. I'm not sure where or why they are even being attempted to be imported now though.

from graphql-language-service.

asiandrummer avatar asiandrummer commented on May 5, 2024

@gdub22 Thanks for reporting ;) webpack/webpack#196 seems to be tracking this issue

from graphql-language-service.

asiandrummer avatar asiandrummer commented on May 5, 2024

@danez I see - thanks for the explanation. To clarify I didn't mean to blame Webpack for this issue - just wanted to mention some alternatives we could try out from that issue. Apologies for confusion.

"require context" sounds like a good alternative to me, with some module name parsing since the module path would come from .graphqlconfig file.

const customValidationRules = require('./dir/' + somePath + '.js');

from graphql-language-service.

tsunammis avatar tsunammis commented on May 5, 2024

@asiandrummer @danez @gdub22 Do you have an idea to make that thing working ?

from graphql-language-service.

tsunammis avatar tsunammis commented on May 5, 2024

@asiandrummer Thanks ;-)

from graphql-language-service.

zdne avatar zdne commented on May 5, 2024

@asiandrummer has this been addressed & published yet?

from graphql-language-service.

jsplink avatar jsplink commented on May 5, 2024

@asiandrummer thanks for the fix! Can you cut a release to publish? Many thanks!

from graphql-language-service.

wincent avatar wincent commented on May 5, 2024

I'm going to cut a codemirror-graphql release shortly and will make sure the deps are up-to-date before I do.

from graphql-language-service.

gpoitch avatar gpoitch commented on May 5, 2024

@wincent thanks for releasing. Unfortunately, this dependency is still locked on the old version in the latest codemirror-graphql 0.6.8 just released.

https://github.com/graphql/codemirror-graphql/blob/28366f8939bb6f2551b938991134e5591c653490/package.json#L52

from graphql-language-service.

wincent avatar wincent commented on May 5, 2024

Ah, thanks for pointing it out @gdub22. I can cut another release later today.

from graphql-language-service.

wincent avatar wincent commented on May 5, 2024

@gdub22: I just cut v0.6.9 (https://github.com/graphql/codemirror-graphql/releases/tag/v0.6.9) — let me know if that doesn't resolve things for you.

from graphql-language-service.

ddgromit avatar ddgromit commented on May 5, 2024

I'm not sure why but codemirror-graphql is still resolving to [email protected]. Tested with fresh packages in both yarn and NPM:

➜   yarn add codemirror-graphql
yarn add v0.24.6
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "[email protected]" has unmet peer dependency "codemirror@^5.26.0".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 8 new dependencies.
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
✨  Done in 1.14s.

No idea why it won't choose 0.0.17 or 0.0.18:

graphql-language-service-interface@^0.0.16:
  version "0.0.16"
  resolved "https://registry.yarnpkg.com/graphql-language-service-interface/-/graphql-language-service-interface-0.0.16.tgz#36f3e0640dd58be1a5c0b5cded47870a065635ec"
  dependencies:
    graphql "^0.10.1"
    graphql-language-service-config "0.0.15"
    graphql-language-service-parser "0.0.14"
    graphql-language-service-types "0.0.20"
    graphql-language-service-utils "0.0.15"

from graphql-language-service.

gpoitch avatar gpoitch commented on May 5, 2024

@wincent I'm getting the same issue/output as @ddgromit

from graphql-language-service.

cberkom avatar cberkom commented on May 5, 2024

Same here. Looks like [email protected] still depends on graphql-language-service-interface@^0.0.16. (Thanks, @wincent)

@gdub22 @ddgromit is there a workaround while we wait?

from graphql-language-service.

ddgromit avatar ddgromit commented on May 5, 2024

Ah the problem is you'd think ^0.0.16 := >=0.0.16 <0.1.0 but it really means ^0.0.3 := >=0.0.3 <0.0.4 since the first leading non-zero number is the patch level version. So, in this particular case the caret is meaningless.

@wincent I think this can be fixed by one of:

  • changing the graphql-language-service-interface version to >=0.0.16 <0.1.0
  • OR bumping the minor versions of all the packages in the next release to 0.1.0 and making the dependencies reference ^0.1.0

The dependency could be set to to graphql-language-service-interface@^0.0.18 like @cberkom suggested which would fix the graphql bug, but wouldn't "loosen" the dependency for the future. 0.0.18 would be the only valid version.

from graphql-language-service.

asiandrummer avatar asiandrummer commented on May 5, 2024

@ddgromit thanks for the analysis. I'm sorry for the trouble this has caused over time - I'll test out the >=0.0.16 < 0.1.0 fix for now. I'll probably be able to do a minor version release soon as well.

from graphql-language-service.

asiandrummer avatar asiandrummer commented on May 5, 2024

@ddgromit @cberkom @gdub22
yarn add codemirror-graphql gives me

Using globally installed version of Yarn
yarn add v0.24.3
warning No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "[email protected]" has unmet peer dependency "codemirror@^5.26.0".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 6 new dependencies.
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
warning No license field
✨  Done in 2.40s.

Could one of you verify 0.6.10 release fixes your issue please?

from graphql-language-service.

asiandrummer avatar asiandrummer commented on May 5, 2024

@gdub22 I'm getting several as well - some of them don't sound right, as they're showing error for not being able to find installed modules such as graphql and codemirror. I'm looking into it

from graphql-language-service.

stubailo avatar stubailo commented on May 5, 2024

Ouch. I hope this doesn't break stuff for people using Browserify as well, since Webpack isn't the only module bundler out there.

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.