-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[lsp-server] 🐞 incorrect bundling of types for graphql-language-server
#3790
Comments
graphql-language-server
This would be fixed by the latest release: #3763 |
I don't think that a "move back to 16" is necessarily required to fix this. (I think that's what you're hinting at, right?) The problem is that the |
Or no, looking at the source code, I think this might actually not be the case and @JoviDeCroock might have overinterpreted things. The problem is not necessarily the bundling itself, but this statement: export const RuleKinds = {
...Kind,
...AdditionalRuleKinds,
}; The spread pulls in all the information about |
That spread, even if it's used as a JS-value, can be imported from |
Yeah, I meant it's not a problem on the build tooling side, which I had assumed you meant. I think this could fix it, I'm trying it out as we speak: export const RuleKinds: Omit<typeof Kind, keyof _AdditionalRuleKinds> &
_AdditionalRuleKinds = {
...Kind,
...AdditionalRuleKinds,
}; |
Oh, even simpler... -export const RuleKinds = {
+export const RuleKinds: _RuleKinds = {
...Kind,
...AdditionalRuleKinds,
}; this would fix it without having to roll back the version of |
I believe we wanted to move back to v16 as the dev dependency because it’s actually re-exported in one of the packages in total, and when we upgraded, we did it under the assumption that it would not affect users at all. So we are definitely moving back to v16, which can be released whenever appropriate. @acao please feel free to jump in if I have that wrong. More broadly, things could be rearchitectured of course! |
graphiql will still support v17, but it won’t be the version in the dev dependency and I assume will fix this problem. |
I'm happy either way :) |
Is there an existing issue for this?
Current Behavior
Currently,
graphql-language-server@5.3.0
causes type errors withgraphql@16.9.0
. Apparently, this package bundles the types of the development dependencygraphql
into the published bundle, which will then cause TypeScript errors.Also see the discussion in graphql/graphql-js#4201
Expected Behavior
As
16.9.0
is a validpeerDependency
, it should not result in TS warnings.Steps To Reproduce
Install
graphql-language-server@5.3.0
andgraphql@16.9.0
, runtsc
.Environment
See this PR: apollographql/vscode-graphql#175 with a failing CI job
Anything else?
No response
The text was updated successfully, but these errors were encountered: