TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

I can't get the interface's props to load properly in the monorepo environment w/o relative path

Open Sn-Kinos opened this issue 2 years ago • 1 comments

Bug Report

🔎 Search Terms

  • monorepo
  • import
  • export
  • interface
  • type annotation
  • absolute path
  • relative path
  • paths on tsconfig.json

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about monorepo

⏯ Playground Link

GitHub Public Repository for this case w/ pnpm. https://github.com/Sn-Kinos/monorepo-interface

It issues on Yarn workspace too.

💻 Code

// We can quickly address your report if:
//  - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
//  - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
//  - The incorrectness of the behavior is readily apparent from reading the sample.
// Reports are slower to investigate if:
//  - We have to pare too much extraneous code.
//  - We have to clone a large repo and validate that the problem isn't elsewhere.
//  - The sample is confusing or doesn't clearly demonstrate what's wrong.

image

With above image, Type annotation for AppObjectWithInterface and AppObjectWithType on apps/app/index.ts didn't work properly.

🙁 Actual behavior

  • LibraryType on apps/ shows it any.
  • LibraryInterface on apps/ does not includes paths and absolute.

🙂 Expected behavior

  • LibraryType on apps/ shows properly.
  • LibraryInterface on apps/ includes paths and absolute.

Sn-Kinos avatar May 04 '23 10:05 Sn-Kinos

Typescript obviously can't know if you're running pnpm or not, so please provide a repro that doesn't depend on that tool

RyanCavanaugh avatar May 04 '23 20:05 RyanCavanaugh

Typescript obviously can't know if you're running pnpm or not, so please provide a repro that doesn't depend on that tool

Can I set up monorepo without pnpm? I did it also with Yarn Workspaces, But It didn't works. 😢

Sn-Kinos avatar May 08 '23 01:05 Sn-Kinos

I also published npm branch that make monorepo with npm. And as I wrote in the text, the same problem occurred in Yarn, so I don't think this is a problem caused by a specific package manager... 🤔

Sn-Kinos avatar May 08 '23 08:05 Sn-Kinos

@RyanCavanaugh May I ask if there is anything else I can do to resolve?

Sn-Kinos avatar May 11 '23 08:05 Sn-Kinos

@Sn-Kinos I'd like you to provide a repro that doesn't require running tools that aren't TypeScript. TypeScript can only see the layout of files on disk so whatever problem you have is related to that layout of files, and should be reproducible

RyanCavanaugh avatar May 12 '23 16:05 RyanCavanaugh