microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.46k stars 29.36k forks source link

TS Server fatal error: Unable to locate pnpapi, the module '/home/lenovo/.yarn/berry/cache/@types-node-npm-20.10.6-59a7d708ba-10c0.zip/node_modules/@types/node/' is controlled by multiple pnpapi instances. #203281

Closed Yeifet closed 9 months ago

Yeifet commented 9 months ago

Type: Bug

❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️

TypeScript Version: 5.3.3-sdk

Steps to reproduce crash

1. 2. 3.

TS Server Log

❗️ Server logging disabled. To help us fix crashes like this, please enable logging by setting:

"typescript.tsserver.log": "verbose"

After enabling this setting, future crash reports will include the server log.

TS Server Error Stack

Server: semantic

This is usually caused by using the global cache (enableGlobalCache: true)

Controlled by:
  /home/lenovo/Documentos/Trabajos/Alnago/community/server/.pnp.cjs
  /home/lenovo/Documentos/Trabajos/Alnago/community/community/.pnp.cjs

Error: Unable to locate pnpapi, the module '/home/lenovo/.yarn/berry/cache/@types-node-npm-20.10.6-59a7d708ba-10c0.zip/node_modules/@types/node/' is controlled by multiple pnpapi instances.
This is usually caused by using the global cache (enableGlobalCache: true)

Controlled by:
  /home/lenovo/Documentos/Trabajos/Alnago/community/server/.pnp.cjs
  /home/lenovo/Documentos/Trabajos/Alnago/community/community/.pnp.cjs

    at Object.findApiPathFor (/home/lenovo/Documentos/Trabajos/Alnago/community/server/.pnp.cjs:11319:13)
    at moduleExports.findPnpApi (/home/lenovo/Documentos/Trabajos/Alnago/community/server/.pnp.cjs:9440:34)
    at getPnpApi (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:41380:12)
    at lookup (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:43752:9)
    at loadModuleFromNearestNodeModulesDirectoryWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:43742:20)
    at loadModuleFromNearestNodeModulesDirectory (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:43711:10)
    at tryResolve (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:42766:21)
    at nodeModuleNameResolverWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:42709:14)
    at bundlerModuleNameResolver (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:42630:10)
    at resolveModuleName (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:42405:18)
    at resolveModuleNameUsingGlobalCache (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:126482:25)
    at Object.resolve (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:126469:45)
    at resolveNamesWithLocalCache (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:126760:29)
    at Object.resolveModuleNameLiterals (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:126849:12)
    at ConfiguredProject2.resolveModuleNameLiterals (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:176962:33)
    at resolveModuleNamesWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:121797:20)
    at resolveModuleNamesReusingOldState (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:121892:14)
    at processImportedModules (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123453:118)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123191:7)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123005:22
    at getSourceFileFromReferenceWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:122974:26)
    at processSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123003:5)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123275:7
    at forEach (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:2349:22)
    at processReferencedFiles (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123274:5)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123185:9)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123005:22
    at getSourceFileFromReferenceWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:122974:26)
    at processSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123003:5)
    at processTypeReferenceDirectiveWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123321:9)
    at processTypeReferenceDirective (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123305:5)
    at processTypeReferenceDirectives (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123299:7)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123186:9)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at processImportedModules (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123479:11)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123191:7)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at processImportedModules (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123479:11)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123191:7)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123005:22
    at getSourceFileFromReferenceWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:122974:26)
    at processSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123003:5)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123275:7
    at forEach (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:2349:22)
    at processReferencedFiles (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123274:5)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123185:9)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123005:22
    at getSourceFileFromReferenceWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:122974:26)
    at processSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123003:5)
    at processTypeReferenceDirectiveWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123346:11)
    at processTypeReferenceDirective (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123305:5)
    at processTypeReferenceDirectives (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123299:7)
    at findSourceFileWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123186:9)
    at findSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123056:20)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123005:22
    at getSourceFileFromReferenceWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:122974:26)
    at processSourceFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:123003:5)
    at processRootFile (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:122800:5)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:121534:41
    at forEach (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:2349:22)
    at createProgram (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:121534:5)
    at synchronizeHostData (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:145118:15)
    at Object.getProgram (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:145192:5)
    at proxy.<computed> [as getProgram] (/home/lenovo/Documentos/Trabajos/Alnago/community/community/.yarn/__virtual__/next-virtual-0c3872e83d/6/.yarn/berry/cache/next-npm-14.0.4-93c7e4ca0b-10c0.zip/node_modules/next/dist/server/typescript/index.js:42:37)
    at ConfiguredProject2.updateGraphWorker (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:177644:41)
    at ConfiguredProject2.updateGraph (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:177495:32)
    at ConfiguredProject2.updateGraph (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:178747:24)
    at _ProjectService.createLoadAndUpdateConfiguredProject (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:180490:13)
    at _ProjectService.assignProjectToOpenedScriptInfo (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:181585:26)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:181865:64
    at flatMap (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:2597:17)
    at _ProjectService.applyChangesInOpenFiles (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:181865:24)
    at updateOpen (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:183086:29)
    at /home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:185688:69
    at IpcIOSession.executeWithRequestId (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:185680:14)
    at IpcIOSession.executeCommand (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:185688:29)
    at IpcIOSession.onMessage (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:185730:51)
    at IpcIOSession.onMessage (/home/lenovo/Documentos/Trabajos/Alnago/community/server/.yarn/sdks/typescript/lib/tsserver.js:201:32)
    at process.<anonymous> (/home/lenovo/.yarn/berry/cache/typescript-patch-4778c7998b-10c0.zip/node_modules/typescript/lib/tsserver.js:187320:14)
    at process.emit (node:events:513:28)
    at process.emit (/home/lenovo/Documentos/Trabajos/Alnago/community/server/.pnp.cjs:9628:25)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:19.222Z) OS version: Linux x64 6.5.0-14-generic Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 x 3299)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|3, 2, 1| |Memory (System)|11.58GB (7.18GB free)| |Process Argv|Community.code-workspace --crash-reporter-id c2053734-ffb5-4d9a-9071-4744ff418e3c| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|wayland|
Extensions (14) Extension|Author (truncated)|Version ---|---|--- vscode-zipfs|arc|3.0.0 jsoncrack-vscode|Ayk|2.0.2 dart-code|Dar|3.80.0 flutter|Dar|3.80.0 vscode-eslint|dba|2.4.4 es7-react-js-snippets|dsz|4.4.3 prettier-vscode|esb|10.1.0 auto-close-tag|for|0.5.15 auto-rename-tag|for|0.1.10 vscode-docker|ms-|1.28.0 remote-containers|ms-|0.327.0 vsliveshare|ms-|1.0.5905 material-icon-theme|PKi|4.33.0 LiveServer|rit|5.7.9 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 vsclangdf:30486550 c4g48928:30535728 azure-dev_surveyone:30548225 0bi6i642:30933247 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 dsvsc019a:30933241 ```
mjbvz commented 9 months ago

This is caused by yarn. Please file an issue against them