tsconfig-paths-webpack-plugin icon indicating copy to clipboard operation
tsconfig-paths-webpack-plugin copied to clipboard

Type error after upgrading to [email protected] (A class can only implement an object type or intersection of object types with statically known members.)

Open rostislav-simonik opened this issue 1 year ago • 1 comments

export declare class TsconfigPathsPlugin implements ResolvePluginInstance {
    source: string;
    target: string;
    log: Logger.Logger;
    baseUrl?: string | undefined;
    absoluteBaseUrl: string;
    extensions: ReadonlyArray<string>;
    referenceMatchMap: Record<string, TsconfigPaths.MatchPathAsync>;
    matchPath: TsconfigPaths.MatchPathAsync;
    constructor(rawOptions?: Partial<Options.Options>);
    apply(resolver: Resolver): void;
}

is failing on implements ResolvePluginInstance with error

A class can only implement an object type or intersection of object types with statically known members.ts(2422)
(alias) type ResolvePluginInstance = {
    [index: string]: any;
    apply: (arg0: Resolver) => void;
} | ((this: Resolver, arg1: Resolver) => void)
import ResolvePluginInstance

rostislav-simonik avatar Sep 07 '24 09:09 rostislav-simonik

Looks like it has become incompatible due to this change in the ResolvePluginInstance type in webpack: https://github.com/webpack/webpack/commit/cf891a416465c5a57201a4fbffb2e6eb114e96dd

Yurickh avatar Sep 13 '24 13:09 Yurickh

@jonaskello Would you be able to release a patch with this change anytime soon?

kvndrsslr avatar Nov 13 '24 07:11 kvndrsslr

This is now published in 4.2.0

jonaskello avatar Nov 15 '24 07:11 jonaskello