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

[lsp-server] 🐞 Cannot find module 'typescript' since v3.3.29 #3497

Closed
1 task done
predragnikolic opened this issue Jan 12, 2024 · 5 comments
Closed
1 task done
Labels
bug lsp-server graphql-language-service-server

Comments

@predragnikolic
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello,

I wanted to update server for the LSP-graphql plugin(for Sublime Text) from 3.3.28 to 3.3.29 in this PR.
And when I did that
the server crashed with the following error message Error: Cannot find module 'typescript'

:: [21:29:09.293] --> LSP-graphql initialize (1): {'capabilities': {'window': {'workDoneProgress': True, 'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}}, 'workspace': {'didChangeWatchedFiles': {'dynamicRegistration': True}, 'workspaceFolders': True, 'diagnostics': {'refreshSupport': True}, 'codeLens': {'refreshSupport': True}, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort'}, 'executeCommand': {}, 'applyEdit': True, 'inlayHint': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'didChangeConfiguration': {'dynamicRegistration': True}, 'symbol': {'tagSupport': {'valueSet': [1]}, 'resolveSupport': {'properties': ['location.range']}, 'symbolKind': {'valueSet': [11, 7, 26, 20, 21, 6, 3, 19, 18, 9, 10, 12, 1, 25, 14, 24, 2, 22, 5, 8, 17, 16, 13, 23, 15, 4]}, 'dynamicRegistration': True}, 'configuration': True}, 'textDocument': {'diagnostic': {'relatedDocumentSupport': True, 'dynamicRegistration': True}, 'documentLink': {'tooltipSupport': True, 'dynamicRegistration': True}, 'signatureHelp': {'signatureInformation': {'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'parameterInformation': {'labelOffsetSupport': True}}, 'contextSupport': True, 'dynamicRegistration': True}, 'hover': {'contentFormat': ['markdown', 'plaintext'], 'dynamicRegistration': True}, 'foldingRange': {'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}, 'dynamicRegistration': True}, 'codeAction': {'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'dataSupport': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}, 'dynamicRegistration': True}, 'completion': {'insertTextMode': 2, 'completionItem': {'snippetSupport': True, 'deprecatedSupport': True, 'labelDetailsSupport': True, 'tagSupport': {'valueSet': [1]}, 'documentationFormat': ['markdown', 'plaintext'], 'insertReplaceSupport': True, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'insertTextModeSupport': {'valueSet': [2]}}, 'completionItemKind': {'valueSet': [8, 10, 25, 24, 15, 2, 18, 23, 4, 16, 13, 1, 11, 3, 17, 21, 7, 9, 20, 19, 5, 12, 6, 22, 14]}, 'completionList': {'itemDefaults': ['editRange', 'insertTextFormat', 'data']}, 'dynamicRegistration': True}, 'selectionRange': {'dynamicRegistration': True}, 'rename': {'prepareSupportDefaultBehavior': 1, 'prepareSupport': True, 'dynamicRegistration': True}, 'typeHierarchy': {'dynamicRegistration': True}, 'formatting': {'dynamicRegistration': True}, 'implementation': {'linkSupport': True, 'dynamicRegistration': True}, 'declaration': {'linkSupport': True, 'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'references': {'dynamicRegistration': True}, 'synchronization': {'willSaveWaitUntil': True, 'willSave': True, 'didSave': True, 'dynamicRegistration': True}, 'typeDefinition': {'linkSupport': True, 'dynamicRegistration': True}, 'definition': {'linkSupport': True, 'dynamicRegistration': True}, 'rangeFormatting': {'rangesSupport': True, 'dynamicRegistration': True}, 'inlayHint': {'resolveSupport': {'properties': ['textEdits', 'label.command']}, 'dynamicRegistration': True}, 'codeLens': {'dynamicRegistration': True}, 'callHierarchy': {'dynamicRegistration': True}, 'semanticTokens': {'requests': {'full': {'delta': True}, 'range': True}, 'tokenTypes': ['interface', 'property', 'typeParameter', 'macro', 'operator', 'type', 'method', 'event', 'modifier', 'enum', 'regexp', 'function', 'keyword', 'class', 'parameter', 'enumMember', 'namespace', 'variable', 'struct', 'decorator', 'string', 'comment', 'number'], 'augmentsSyntaxTokens': True, 'overlappingTokenSupport': False, 'formats': ['relative'], 'tokenModifiers': ['async', 'documentation', 'modification', 'definition', 'readonly', 'abstract', 'static', 'deprecated', 'declaration', 'defaultLibrary'], 'multilineTokenSupport': True, 'dynamicRegistration': True}, 'colorProvider': {'dynamicRegistration': True}, 'documentSymbol': {'tagSupport': {'valueSet': [1]}, 'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [11, 7, 26, 20, 21, 6, 3, 19, 18, 9, 10, 12, 1, 25, 14, 24, 2, 22, 5, 8, 17, 16, 13, 23, 15, 4]}, 'dynamicRegistration': True}, 'publishDiagnostics': {'codeDescriptionSupport': True, 'relatedInformation': True, 'dataSupport': True, 'versionSupport': True, 'tagSupport': {'valueSet': [1, 2]}}}, 'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'parser': 'Python-Markdown', 'version': '3.2.2'}}}, 'clientInfo': {'version': '1.27.0', 'name': 'Sublime Text LSP'}, 'rootPath': '/home/predragnikolic/.config/sublime-text/Packages/LSP-graphql', 'workspaceFolders': [{'uri': 'file:///home/predragnikolic/.config/sublime-text/Packages/LSP-graphql', 'name': 'LSP-graphql'}], 'processId': 27349, 'rootUri': 'file:///home/predragnikolic/.config/sublime-text/Packages/LSP-graphql', 'initializationOptions': {}}
LSP-graphql: node:internal/modules/cjs/loader:1087
LSP-graphql:   throw err;
LSP-graphql:   ^
LSP-graphql: 
LSP-graphql: Error: Cannot find module 'typescript'
LSP-graphql: Require stack:
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/svelte2tsx/index.js
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/parsers/svelte.js
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/findGraphQLTags.js
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/parseDocument.js
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/MessageProcessor.js
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/index.js
LSP-graphql: - /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/start-server.js
LSP-graphql:     at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
LSP-graphql:     at node:internal/modules/cjs/loader:929:27
LSP-graphql:     at Function._load (node:electron/js2c/asar_bundle:2:13327)
LSP-graphql:     at Module.require (node:internal/modules/cjs/loader:1150:19)
LSP-graphql:     at require (node:internal/modules/cjs/helpers:121:18)
LSP-graphql:     at Object.<anonymous> (/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/svelte2tsx/index.js:4:10)
LSP-graphql:     at Module._compile (node:internal/modules/cjs/loader:1271:14)
LSP-graphql:     at Object..js (node:internal/modules/cjs/loader:1326:10)
LSP-graphql:     at Module.load (node:internal/modules/cjs/loader:1126:32)
LSP-graphql:     at node:internal/modules/cjs/loader:967:12 {
LSP-graphql:   code: 'MODULE_NOT_FOUND',
LSP-graphql:   requireStack: [
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/svelte2tsx/index.js',
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/parsers/svelte.js',
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/findGraphQLTags.js',
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/parseDocument.js',
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/MessageProcessor.js',
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/node_modules/graphql-language-service-server/dist/index.js',
LSP-graphql:     '/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-graphql/18.17.1/language-server/start-server.js'
LSP-graphql:   ]
LSP-graphql: }
LSP-graphql: 
LSP-graphql: Node.js v18.17.1

Expected Behavior

Because this is a patch update.
I would not expect such errors to happen.

I would consider this error OK if this was marked as a breaking change with a suitable version 43.x.x change (if this change was intentional).

Steps To Reproduce

  1. Update the server from from 3.3.28 to 3.3.29
  2. Open a file that will start the server.

Environment

  • LSP Server Version: 3.3.29
  • OS: Linux
  • LSP Client: LSP-graphql for Sublime Text.

Anything else?

No response

@predragnikolic predragnikolic added bug lsp-server graphql-language-service-server labels Jan 12, 2024
@acao
Copy link
Member

acao commented Jan 13, 2024

strange, I will look into it - we upgraded graphql-config which uses typescript at runtime, so perhaps there was a breaking change in our dependency

@acao
Copy link
Member

acao commented Jan 13, 2024

I think it's related to #3496 with a new dependency for svelte parsing

@predragnikolic
Copy link
Author

Think you @acao for looking into it!

@favna
Copy link

favna commented Jan 13, 2024

This also happens with the VSCode extension GraphQL: Language Feature Support (GraphQL.vscode-graphql) starting version 0.8.23

@acao
Copy link
Member

acao commented Jan 13, 2024

@favna yes, the next patch release should fix it here in a few minutes. this error occurs in both places because vscode-graphql is just a thin client reference implementation of the LSP server

again, I wish there was a way that tests could help us with this, but the possibility to test for these kinds of bugs does not exist for vscode or LSP servers yet

@acao acao closed this as completed Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lsp-server graphql-language-service-server
Projects
None yet
Development

No branches or pull requests

3 participants