microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.3k stars 12.53k forks source link

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

Closed Sn-Kinos closed 3 months ago

Sn-Kinos commented 1 year ago

Bug Report

πŸ”Ž Search Terms

πŸ•— Version & Regression Information

⏯ 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

πŸ™‚ Expected behavior

RyanCavanaugh commented 1 year ago

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

Sn-Kinos commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

RyanCavanaugh commented 1 year ago

@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