From a6ecc7c8c85fc40cc031a9b55a9acd2e858b3b58 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 7 Dec 2018 11:43:02 -0800 Subject: [PATCH] proto loader: Fall back to default path resolution --- packages/proto-loader/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/proto-loader/src/index.ts b/packages/proto-loader/src/index.ts index 36ef263d..1c09fbaa 100644 --- a/packages/proto-loader/src/index.ts +++ b/packages/proto-loader/src/index.ts @@ -118,6 +118,7 @@ function createPackageDefinition(root: Protobuf.Root, options: Options): Package } function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) { + const originalResolvePath = root.resolvePath; root.resolvePath = (origin: string, target: string) => { if (path.isAbsolute(target)) { return target; @@ -131,7 +132,7 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) { continue; } } - throw new Error(`Could not find file ${target}`); + return originalResolvePath(origin, target); }; }