diff --git a/packages/fiber/src/core/hooks.tsx b/packages/fiber/src/core/hooks.tsx index 8317e09fb4..9adcccf528 100644 --- a/packages/fiber/src/core/hooks.tsx +++ b/packages/fiber/src/core/hooks.tsx @@ -12,7 +12,7 @@ export interface Loader extends THREE.Loader { url: string, onLoad?: (result: T) => void, onProgress?: (event: ProgressEvent) => void, - onError?: (event: ErrorEvent) => void, + onError?: (event: unknown) => void, ): unknown loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise } @@ -101,12 +101,12 @@ function loadingFn>( new Promise((res, reject) => loader.load( input, - (data: any) => { + (data) => { if (data.scene) Object.assign(data, buildGraph(data.scene)) res(data) }, onProgress, - (error) => reject(new Error(`Could not load ${input}: ${error.message}`)), + (error) => reject(new Error(`Could not load ${input}: ${(error as ErrorEvent)?.message}`)), ), ), ),