language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Local package (module) dependencies tracking in monorepo (npm workspaces) broken in latest version (v2.0.7)

Open LifeJustDLC opened this issue 1 year ago • 1 comments

When I make the following change:

// api/index.ts outside "vue project"
// (sub module in my monorepo, project structure is described later)
export type theType = number // from this
export type theType = string // to this, and ctrl+S.

The error in following file won't be detected before restarting Vscode (or extension host):

<script setup lang="ts">
import type { theType } from "api"
cost num: theType = 1 // won't complain any error before reload.

This problem only exist in (v2.0.7). It works normally in (v2.0.6) (I've downgraded to this).

Project structure:

root
 - api
   - index.ts
   - index.js
   - index.d.ts
   - package.json
 - fe
   - src
     - App.vue
     - ...
 - pacakge.json
// root/api/package.json:
{
  "name": "api",
  "types": "index.d.ts",
  "devDependencies": {
    "typescript": "^5.4.3"
  },
  "scripts": {
    "build": "tsc index.ts -d",
    "dev": "tsc index.ts -d -w"
  }
}
// root/package.json
{
  "name": "homework",
  "scripts": {},
  "workspaces": [
    "be",
    "fe",
    "api"
  ]
}

dev command:

(root) $ npm run dev -w api

package.json and tsconfig.json inside fe are all Vue defualt boilerplates, reamain untouched.

LifeJustDLC avatar Mar 26 '24 09:03 LifeJustDLC

Done editing. (Hope this will triggle some notification)

LifeJustDLC avatar Mar 26 '24 10:03 LifeJustDLC

Hey there, as there have been many fixes in the last 2.x versions: Please let us know if you're still encountering this issue. Otherwise kindly close this one, thanks!

davidmatter avatar Aug 07 '24 07:08 davidmatter

@davidmatter image

bosens-China avatar Aug 08 '24 08:08 bosens-China

@LifeJustDLC The issue you reported seems kind of unusual. Please provide a minimal reproduction project and re-open this issue. Thanks!

@bosens-China This seems to be another issue. Please check your tsconfig.json, and open a new issue if there are still unexpected behaviors. Thanks!

kermanx avatar Aug 13 '24 14:08 kermanx