From 6f5a75e4ffc59226a82dd75574cace799e0bed4b Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 4 Oct 2023 20:48:52 +0000 Subject: [PATCH 1/2] fix(site/api): change `utils/delay` import path For some reason this fails when imported into `vscode-coder`. ``` ERROR in /home/coder/vscode-coder/node_modules/coder/site/src/api/api.ts ./node_modules/coder/site/src/api/api.ts 6:22-35 [tsl] ERROR in /home/coder/vscode-coder/node_modules/coder/site/src/api/api.ts(6,23) TS2307: Cannot find module 'utils/delay' or its corresponding type declarations. ``` After changing the import to add `../xxx` the error went away. I don't really understand why. --- site/src/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/api/api.ts b/site/src/api/api.ts index a7f6a9688aebf..c92740491a30f 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -1,7 +1,7 @@ import axios from "axios"; import dayjs from "dayjs"; import * as TypesGen from "./typesGenerated"; -import { delay } from "utils/delay"; +import { delay } from "../utils/delay"; import userAgentParser from "ua-parser-js"; // Adds 304 for the default axios validateStatus function From 1e4a54be3385cbba9cb54916d4d031e9033184e9 Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 4 Oct 2023 20:55:39 +0000 Subject: [PATCH 2/2] add comment --- site/src/api/api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/site/src/api/api.ts b/site/src/api/api.ts index c92740491a30f..c441edd7661ab 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -1,6 +1,8 @@ import axios from "axios"; import dayjs from "dayjs"; import * as TypesGen from "./typesGenerated"; +// This needs to include the `../`, otherwise it breaks when importing into +// vscode-coder. import { delay } from "../utils/delay"; import userAgentParser from "ua-parser-js";