-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 4.0.3
Code
This is the repo of demo https://github.com/haha370104/lerna-typescript-error
These files just like this.
export const enum TestEnum {
Test1 = '123123',
Test2 = '12312312312',
}
export interface ITest {
[TestEnum.Test1]: string;
[TestEnum.Test2]: string;
}
export class A {
getA(): ITest {
return {
[TestEnum.Test1]: '123',
[TestEnum.Test2]: '123',
};
}
}
// packages/ts-error/src/index.ts
import {A} from './class';
export class B extends A {
getA() { // TS4053 error
return {
...super.getA(),
a: '123',
};
}
}
Actual behavior:
The "getA" method of class B will cause an error as " error TS4053: Return type of public method from exported class has or is using name 'TestEnum' from external module "/Users/admin/lerna-test/packages/ts-error/src/class" but cannot be named". But if i move these two files to root director, the error will disappear.
I'm don't know why these two file will be recognized to be external module when they in the same lerna package. Also I'm not sure this is a ts issue or my mistake. But it has already cost days for me to search the answer but without result.
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue