-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Dependencies linked with a symbolic link (by lerna
) break the transpilation when using rxjs
#20945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Andy-MS can you take a look. |
Simplified repro: // @noImplicitReferences: true
// @Filename: /node_modules/a/node_modules/foo/package.json
{
"name": "foo",
"version": "1.2.3"
}
// @Filename: /node_modules/a/node_modules/foo/index.d.ts
export class C {
private x: number;
}
// @Filename: /node_modules/a/index.d.ts
import { C } from "foo";
export const o: C;
// @Filename: /node_modules/foo/use.d.ts
import { C } from "./index";
export function use(o: C): void;
// @Filename: /node_modules/foo/index.d.ts
export class C {
private x: number;
}
// @Filename: /node_modules/foo/package.json
{
"name": "foo",
"version": "1.2.3"
}
// @Filename: /index.ts
import { use } from "foo/use";
import { o } from "a";
use(o); The problem is that |
Thanks for looking into this @Andy-MS! |
@Andy-MS, |
A bit more information:
So
So On the other hand, if I replace the symlink with the normal dependency (simply do
|
I spent quite some time today debugging This is what I saw when debugging If the dependency is a symlink
If the dependency is there physically
|
I found two workarounds for the issue (thanks to @evocateur for the first, and to @fahad19 for the second 😉).
So now I can work around the original issue, but I guess this is still possibly a problem with the TypeScript compiler? |
Setup
The issue happens in a repository containing two npm packages
The class exported from
lerna-typescript-demo-base
,Foo
has two functions, one is returningBar[]
, and the other is returning an rxjsObservable
, specificallyObservable<Bar[]>
.In
lerna-typescript-demo-ts
we try to use both functions, and the transpilation of the usage of the one returning theObservable
fails.Code
A repro is uploaded here: https://github.com/markvincze/lerna-typescript-demo
The steps to reproduce are in the README.
Expected behavior:
Transpilation should succeed.
Actual behavior:
Transpilation fails with
Comments:
I tried also with
typescript@next
, but get the same error.I suspect this is related to the symlink dependency, because if I replace that with the ordinary in-place dependency, the error goes away. Also, this is only happening with the function returning an
Observable
, so it might also be related torxjs
somehow.(I've seen a number of other issues about symlinks, but they were either closed as fixed, outdated, or just didn't have a clear repro.)
The text was updated successfully, but these errors were encountered: