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

typescript plugin conflict with typescript-lit-html-plugin and typescript-plugin-css-modules #4246

Closed
zulus opened this issue Apr 10, 2024 · 6 comments
Labels

Comments

@zulus
Copy link
Contributor

zulus commented Apr 10, 2024

If I use any of this plugin in tsserver configuration, vue start crashing or I see __VLS_* completions everywhere

Part from logs (on crash)

Debug Failure. Did not expect ImportDeclaration to have an Identifier in its trivia
Error: Debug Failure. Did not expect ImportDeclaration to have an Identifier in its trivia
	at addSyntheticNodes (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145461:15)
	at processNode (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145435:5)
	at visitNode2 (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30479:18)

EDIT, I see same error even without plugins, LOGS:

Error: Debug Failure. Did not expect ImportDeclaration to have an Identifier in its trivia
        at addSyntheticNodes (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145461:15)
        at processNode (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145435:5)
        at visitNode2 (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30479:18)
        at forEachChildInImportDeclaration (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30785:59)
        at forEachChild (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30996:35)
        at NodeObject.forEachChild (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145418:12)
        at createChildren (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145446:8)
        at NodeObject.getChildren (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145397:48)
        at NodeObject.getLastToken (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:145410:27)
        at visit (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:134992:30)
        at visitNodes (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30487:22)
        at forEachChildInSourceFile (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30700:12)
        at forEachChild (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:30996:35)
        at probablyUsesSemicolons (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:134990:3)
        at getCompletionEntriesFromSymbols (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:160368:25)
        at completionInfoFromData (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:159453:23)
        at Object.getCompletionsAtPosition (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:158995:24)
        at getCompletionsAtPosition2 (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:146552:35)
        at languageService.getCompletionsAtPosition (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/@volar/typescript/lib/node/decorateLanguageService.js:496:32)
        at languageService.getCompletionsAtPosition (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/@vue/typescript-plugin/lib/common.js:10:24)
        at IpcIOSession.getCompletions (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:186786:54)
        at completionInfo (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:185176:43)
        at /Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:187570:69
        at IpcIOSession.executeWithRequestId (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:187562:14)
        at IpcIOSession.executeCommand (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:187570:29)
        at IpcIOSession.onMessage (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:187612:51)
        at process.<anonymous> (/Users/zulus/www/eclipse/wildwebdeveloper/org.eclipse.wildwebdeveloper/node_modules/typescript/lib/tsserver.js:189221:14)
        at process.emit (node:events:517:28)
        at emit (node:internal/child_process:944:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
@johnsoncodehk
Copy link
Member

You can configure "vue.server.hybridMode": false in VSCode settings to avoid uncontrollable compatibility issues. (See #4206)

@johnsoncodehk johnsoncodehk added external and removed bug Something isn't working labels Apr 12, 2024
@zulus
Copy link
Contributor Author

zulus commented Apr 12, 2024

This exception appear in standalone tsserver (via typescript-language-server, not is vscode

This settings doesn’t change anything, and as i wrote in edit, problem appear even without extra plugins

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Apr 12, 2024

This is a fault tolerance issue with tsserver, see microsoft/TypeScript#57630. This needs to be fixed by typescript-lit-html-plugin/typescript-plugin-css-modules themselves. For the record, I've added typescript-lit-html-plugin/typescript-plugin-css-modules to the incompatibility list for #4206.

@samuliraty
Copy link

Is this related?

In neovim i get bombarded with:

tsserver: 1: <semantic> TypeScript Server Error (5.3.3)
Debug Failure. Did not expect ImportDeclaration to have an Identifier in its trivia
Error: Debug Failure. Did not expect ImportDeclaration to have an Identifier in its trivia
    at addSyntheticNodes (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:143992:15)
    at processNode (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:143966:5)
    at visitNode2 (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:30227:18)
    at forEachChildInImportDeclaration (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:30533:59)
    at NodeObject.forEachChild (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:143949:12)
    at createChildren (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:143977:8)
    at NodeObject.getChildren (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:143928:48)
    at getTokenAtPositionWorker (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:132140:32)
    at getTouchingToken (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:132113:10)
    at getTouchingPropertyName (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:132110:10)
    at getReferencesAtLocation (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:163581:31)
    at getReferencesInContainer (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:163574:7)
    at getReferencesInContainerOrFiles (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:163157:7)
    at getReferencedSymbolsForSymbol (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:163150:7)
    at Object.getReferencedSymbolsForNode (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:162897:24)
    at Object.getReferenceEntriesForNode (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:162541:30)
    at getSemanticDocumentHighlights (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:135411:59)
    at Object.getDocumentHighlights (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:135399:12)
    at getDocumentHighlights (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:145195:31)
    at C:\x\y\z\z.foo\bar\node_modules\@volar\typescript\lib\node\decorateLanguageService.js:204:120
    at process (C:\x\y\z\z.foo\bar\node_modules\@volar\typescript\lib\node\decorateLanguageService.js:609:28)
    at linkedCodeFeatureWorker (C:\x\y\z\z.foo\bar\node_modules\@volar\typescript\lib\node\decorateLanguageService.js:596:21)
    at languageService.getDocumentHighlights (C:\x\y\z\z.foo\bar\node_modules\@volar\typescript\lib\node\decorateLanguageService.js:204:28)
    at IpcIOSession.getDocumentHighlights (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:184178:61)
    at documentHighlights (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:183149:43)
    at c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:185375:69
    at IpcIOSession.executeWithRequestId (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:185367:14)
    at IpcIOSession.executeCommand (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:185375:29)
    at IpcIOSession.onMessage (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:185417:51)
    at process.<anonymous> (c:\x\y\z\z.foo\bar\node_modules\typescript\lib\tsserver.js:186999:14)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Project Dependencies:

...
    "dependencies": {
        "@headlessui/vue": "^1.7.19",
        "pinia": "^2.1.7",
        "validator": "^13.11.0",
        "vue": "^3.3.11",
        "vue-i18n": "^9.9.1",
        "vue-router": "^4.2.5"
    },
    "devDependencies": {
        "@total-typescript/ts-reset": "^0.5.1",
        "@tsconfig/node18": "^18.2.2",
        "@types/node": "^18.19.3",
        "@types/validator": "^13.11.9",
        "@vitejs/plugin-vue": "^4.5.2",
        "@vue/tsconfig": "^0.5.0",
        "@vue/typescript-plugin": "^2.0.13",
        "autoprefixer": "^10.4.17",
        "npm-run-all2": "^6.1.1",
        "postcss": "^8.4.33",
        "prettier": "^3.2.4",
        "tailwindcss": "^3.4.1",
        "typescript": "~5.3.0",
        "vite": "^5.0.10",
        "vue-tsc": "^1.8.25"
    }
...

neovim config (init.lua)

...
        tsserver = {
          init_options = {
            plugins = {
              {
                name = '@vue/typescript-plugin',
                location = '...',
                languages = { 'vue' },
              },
            },
          },
...

@johnsoncodehk
Copy link
Member

@samuliraty Please try update @vue/typescript-plugin to 2.0.14.

@beselig
Copy link

beselig commented Apr 25, 2024

@samuliraty Please try update @vue/typescript-plugin to 2.0.14.

That actually worked for me. I was 1 patch version behind.

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

No branches or pull requests

5 participants