diff --git a/web/ui/react-app/package-lock.json b/web/ui/react-app/package-lock.json index 50ab93690..dc48c4047 100644 --- a/web/ui/react-app/package-lock.json +++ b/web/ui/react-app/package-lock.json @@ -77,7 +77,7 @@ "prettier": "^2.3.2", "react-scripts": "4.0.3", "sinon": "^9.0.3", - "typescript": "^3.3.3" + "typescript": "^4.4.2" }, "optionalDependencies": { "fsevents": "^2.3.2" @@ -22808,9 +22808,9 @@ } }, "node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", + "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -43168,9 +43168,9 @@ } }, "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", + "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", "dev": true }, "unbox-primitive": { diff --git a/web/ui/react-app/package.json b/web/ui/react-app/package.json index 7fd78df0d..f75e7f292 100644 --- a/web/ui/react-app/package.json +++ b/web/ui/react-app/package.json @@ -92,7 +92,7 @@ "prettier": "^2.3.2", "react-scripts": "4.0.3", "sinon": "^9.0.3", - "typescript": "^3.3.3" + "typescript": "^4.4.2" }, "proxy": "http://localhost:9090", "jest": { diff --git a/web/ui/react-app/src/hooks/useFetch.ts b/web/ui/react-app/src/hooks/useFetch.ts index efefde7d4..e220ff6aa 100644 --- a/web/ui/react-app/src/hooks/useFetch.ts +++ b/web/ui/react-app/src/hooks/useFetch.ts @@ -34,7 +34,8 @@ export const useFetch = >(url: string, options?: R const json = (await res.json()) as APIResponse; setResponse(json); setIsLoading(false); - } catch (error) { + } catch (err: unknown) { + const error = err as Error; setError(error); } }; diff --git a/web/ui/react-app/src/pages/graph/Panel.tsx b/web/ui/react-app/src/pages/graph/Panel.tsx index ed6a6acdf..e081cf106 100644 --- a/web/ui/react-app/src/pages/graph/Panel.tsx +++ b/web/ui/react-app/src/pages/graph/Panel.tsx @@ -200,7 +200,8 @@ class Panel extends Component { loading: false, }); this.abortInFlightFetch = null; - } catch (error) { + } catch (err: unknown) { + const error = err as Error; if (error.name === 'AbortError') { // Aborts are expected, don't show an error for them. return; diff --git a/web/ui/react-app/src/pages/targets/EndpointLink.tsx b/web/ui/react-app/src/pages/targets/EndpointLink.tsx index d0376a140..083017225 100644 --- a/web/ui/react-app/src/pages/targets/EndpointLink.tsx +++ b/web/ui/react-app/src/pages/targets/EndpointLink.tsx @@ -10,10 +10,11 @@ const EndpointLink: FC = ({ endpoint, globalUrl }) => { let url: URL; try { url = new URL(endpoint); - } catch (e) { + } catch (err: unknown) { + const error = err as Error; return ( - Error: {e.message} + Error: {error.message} ); } diff --git a/web/ui/react-app/tsconfig.json b/web/ui/react-app/tsconfig.json index f97ba5e0e..8615ce31c 100644 --- a/web/ui/react-app/tsconfig.json +++ b/web/ui/react-app/tsconfig.json @@ -17,7 +17,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react", + "jsx": "react-jsx", "noFallthroughCasesInSwitch": true }, "include": [