Skip to content

Plugin module resolve should respect yarn link #44289

@Kingwl

Description

@Kingwl

Bug Report

🔎 Search Terms

plugin, resolve modules, yarn link, symbol link

🕗 Version & Regression Information

  • I was unable to test this on prior versions because Well...

Repro

  1. We have a project:

tsconfig.json

{
    "compilerOptions": {
        "plugins": [
            { "name": "test_plugin" }
        ],
        "preserveSymlinks": true
    }
}

PS: preserveSymlinks is not matter

package.json

{
  "name": "demo",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "test_plugin": "file:../..",
    "typescript": "^4.3.2"
  }
}

index.ts

var a = 123
var b = a + 123
var c = b + 321
var d = a + b + c
  1. build TypeScript, gulp local && gulp lkg
  2. run yarn link in TypeScript project
  3. run yarn link typescript in out project
  4. open index.ts
  5. use workspace version typescript

Log outputs

Info 27   [15:17:58.112] Enabling plugin test_plugin from candidate paths: 
/opensource/TypeScript/lib/tsserver.js/../../..,c:\Program Files\Microsoft VS Code\resources\app\extensions\typescript-language-features

Obviously, the first candidate path is not correct, and the plugin loaded failed.

And It's works fine if I choice the tarball pack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Module ResolutionHow to turn an import specifier into a .d.ts, .ts, or .js file on disk

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions