π Search Terms
"specifier", "relative path"
π Version & Regression Information
β― Playground Link
https://github.com/xlianghang/ts-specifier-bug
π» Code
//src/main.ts
import { PartialType } from './utils';
class Common {}
export class Sub extends PartialType(Common) {
id: string;
}
// src/utils/index.ts
import { MyType, MyReturnType } from './type-helpers';
export function PartialType<T>(classRef: MyType<T>) {
abstract class PartialClassType {
constructor() {}
}
return PartialClassType as MyReturnType;
}
// src/utils/type-helpers.ts
export type MyReturnType = {
new (...args: any[]): any;
};
export interface MyType<T = any> extends Function {
new (...args: any[]): T;
}
π Actual behavior

The dist folder is not the root directory, so do not import from src
π Expected behavior

Import from a relative path
Additional information about the issue
Compilation fails in the MacOS, but is expected to behave in the https://stackblitz.com/~/github.com/xlianghang/ts-specifier-bug
π» MacOS 14.3οΌApple M2 Max
π Search Terms
"specifier", "relative path"
π Version & Regression Information
package.jsonimportsfieldΒ #55015β― Playground Link
https://github.com/xlianghang/ts-specifier-bug
π» Code
π Actual behavior
The
distfolder is not the root directory, so do not import fromsrcπ Expected behavior
Import from a relative path
Additional information about the issue
Compilation fails in the MacOS, but is expected to behave in the https://stackblitz.com/~/github.com/xlianghang/ts-specifier-bug
π» MacOS 14.3οΌApple M2 Max