diff --git a/package.json b/package.json index 4b00904bf..a1e2866a6 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "mocha": "^6.0.0", "prettier": "^2.0.5", "rimraf": "^2.6.2", - "typescript": "^4.0.0", + "typescript": "^4.6.3", "webpack": "^4.5.0", "webpack-cli": "^3.1.1" }, diff --git a/src/instances.ts b/src/instances.ts index aaa36b792..914888edb 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -380,7 +380,9 @@ export function initializeInstance( customerTransformers = require(customerTransformers); } catch (err) { throw new Error( - `Failed to load customTransformers from "${instance.loaderOptions.getCustomTransformers}": ${err.message}` + `Failed to load customTransformers from "${ + instance.loaderOptions.getCustomTransformers + }": ${err instanceof Error ? err.message : ''}` ); } diff --git a/src/interfaces.ts b/src/interfaces.ts index 6fec20479..6d9cc06d7 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -198,6 +198,7 @@ interface PerModuleNameCache { result: typescript.ResolvedModuleWithFailedLookupLocations ): void; } + export interface ModuleResolutionCache extends typescript.ModuleResolutionCache { directoryToModuleNameMap: CacheWithRedirects< @@ -206,8 +207,8 @@ export interface ModuleResolutionCache moduleNameToDirectoryMap: CacheWithRedirects; clear(): void; update(compilerOptions: typescript.CompilerOptions): void; - getPackageJsonInfoCache?(): any; } + // Until the API has been released and ts-loader is built against a version of TypeScript that contains it - see https://github.com/microsoft/TypeScript/blob/74993a2a64bb2e423b40204bb54ff749cdd4ef54/src/compiler/moduleNameResolver.ts#L458 export interface TypeReferenceDirectiveResolutionCache { getOrCreateCacheForDirectory( diff --git a/yarn.lock b/yarn.lock index ea6e337a9..f078dd007 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6267,10 +6267,10 @@ typedarray@^0.0.6: resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" - integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== +typescript@^4.6.3: + version "4.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" + integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== uglify-js@3.3.x: version "3.3.9"