From 28b052c873e13c9ae0eac1f4ab02cbd11c853601 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 10 Sep 2021 17:51:59 +0800 Subject: [PATCH] build: no emit on error --- src/use-swr.ts | 2 +- tsconfig.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/use-swr.ts b/src/use-swr.ts index 0a9d0ca35..30b799f38 100644 --- a/src/use-swr.ts +++ b/src/use-swr.ts @@ -275,7 +275,7 @@ export const useSWRHandler = ( // Keep the stale data but update error. setState({ isValidating: false, - error: err + error: err as Error }) if (!shouldDedupe) { // Broadcast to update the states of other hooks. diff --git a/tsconfig.json b/tsconfig.json index 3a446ac12..2d69d990d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,7 @@ "strict": true, "target": "es5", "baseUrl": ".", + "noEmitOnError": true, "paths": { "swr": ["./src/index.ts"], "swr/infinite": ["./infinite/index.ts"],