🔎 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