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

vscode-graphql language service server fails to start after extension update #2662

Closed
parkerault opened this issue Aug 11, 2022 · 6 comments · Fixed by #2664
Closed

vscode-graphql language service server fails to start after extension update #2662

parkerault opened this issue Aug 11, 2022 · 6 comments · Fixed by #2664

Comments

@parkerault
Copy link

I updated my vscode-graphql extension today and the language service server fails with the following error log:

8/11/2022, 3:16:06 PM [3] (pid: 24897) graphql-language-service-usage-logs: {"type":"usage","messageType":"initialize"}
8/11/2022, 3:16:06 PM [1] (pid: 24897) graphql-language-service-usage-logs: WARNING: graphql-config error, only highlighting is enabled:
Cannot find module '@cspotcode/source-map-support'
Require stack:
- /Users/parker/.vscode-insiders/extensions/graphql.vscode-graphql-0.7.2/out/server/index.js
for more information on using 'graphql-config' with 'graphql-language-service-server', 
see the documentation at https://www.npmjs.com/package/graphql-language-service-server#user-content-graphql-configuration-file
8/11/2022, 3:16:06 PM [1] (pid: 24897) graphql-language-service-usage-logs: WARNING: graphql-config error, only highlighting is enabled:
Cannot find module '@cspotcode/source-map-support'
Require stack:
- /Users/parker/.vscode-insiders/extensions/graphql.vscode-graphql-0.7.2/out/server/index.js
for more information on using 'graphql-config' with 'graphql-language-service-server', 
see the documentation at https://www.npmjs.com/package/graphql-language-service-server#user-content-graphql-configuration-file
8/11/2022, 3:16:06 PM [1] (pid: 24897) graphql-language-service-usage-logs: WARNING: graphql-config error, only highlighting is enabled:
Cannot find module '@cspotcode/source-map-support'
Require stack:
- /Users/parker/.vscode-insiders/extensions/graphql.vscode-graphql-0.7.2/out/server/index.js
for more information on using 'graphql-config' with 'graphql-language-service-server', 
see the documentation at https://www.npmjs.com/package/graphql-language-service-server#user-content-graphql-configuration-file

The graphqlrc has not changed since before the upgrade, but this is the config:

projects:
    default:
        schema:
            - './packages/snclient-graphql-types/src/generated/schema.graphql'
            - './packages/snclient-graphql-types/src/DevelopmentMocks.graphql'
        extensions:
            codegen:
                generates:
                    packages/graphql-types/src/generated/graphqlTypings.ts:
                        schema:
                            - https://dev.example.com/graphql:
                                headers:
                                    Authorization: Bearer ${API_ACCESS_TOKEN}
                        plugins:
                            - typescript
                            - add:
                                content: "import {JSON} from '../CustomScalars'"
                            - add:
                                content: "export type UnMaybe<T> = Exclude<T, undefined | null>;"
                        config:
                            scalars:
                                After: string
                                Before: string
                                DirectionTreeInput: JSON
                                DistributionMetricDataInput: JSON
                                # A field whose value matches the provided regular expression /^1$/.
                                FacebookBusinessCAMV1Version: string
                                Filter: string
                                First: number
                                # A field whose value matches the provided regular expression /^1$/.
                                InstagramFeedV1Version: string
                                # A field whose value matches the provided regular expression /^1$/.
                                InstagramStorySegmentV1Version: string
                                JSON: JSON
                                Last: number
                                OrderBy: string
                                OrderDataInput: JSON
                                OrderDir: "'asc' | 'desc'"
                                ProductionTreeInput: JSON
                                Search: string
                                SocialAccountCreateInput: JSON
                                UnixTimeSec: number

                    packages/graphql-types/src/generated/possibleTypes.ts:
                        plugins:
                            - 'fragment-matcher'
                    packages/graphql-types/src/generated/schema.graphql:
                        plugins:
                            - 'schema-ast'
                overwrite: true

Environment:

Extension: graphql.vscode-graphql v0.7.2
Version: 1.71.0-insider (Universal)
Commit: dced70bbf36d3c53c08e791da1791ac7fc42519b
Date: 2022-08-10T05:18:38.020Z
Electron: 19.0.11
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 20.6.0
Sandboxed: Yes
@htunnicliff
Copy link

htunnicliff commented Aug 11, 2022

I noticed the same broken behavior. Reverting to v0.7.1 fixed the issue for me.

@acao
Copy link
Member

acao commented Aug 11, 2022

oh fun, I have to revert the bugfix again 😂 this is a repeat of the same dependency resolution bug from last week.

break the app for 20% of users so it works for the 40% i broke it for. sorry graphql.config.ts/.graphqlrc.ts users, reverting the bugfix...

the developer had doubly confirmed the fix worked for him locally but I didn't have time to confirm myself, it seems it was a false positive. I will fix the bugs this revert re-introduces later.

@acao
Copy link
Member

acao commented Aug 11, 2022

ah yep, and you're both using schema fetch

this was the same bug. I think i will close this ticket and re-open this one since it has more context

#2619

@acao
Copy link
Member

acao commented Aug 11, 2022

ok, it should be fixed now, i tested locally with clean build and everything!

i apologize, i wish our graphql-language-service-server unit tests could catch this, but the schema fetch is mocked of course. e2e is a bit tricky with vscode but there are some new approaches that would prevent more issues like this in the future. also we need to return to Divyendu's practice of version pinning and carefully manually testing on dependency changes, even if there is an e2e suite

though graphql.config.ts and .graphqlconfig.ts will no longer work, but I will fix that bug when i get a chance

hope the revert works for now, gnite!

@acao
Copy link
Member

acao commented Aug 15, 2022

@parkerault is the issue fixed for you by the way?

@parkerault
Copy link
Author

@parkerault is the issue fixed for you by the way?

Yes, it seems to be working now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants