Skip to content

Commit 0d16df9

Browse files
authored
fix: importing api into vscode-coder (#12570)
1 parent efba477 commit 0d16df9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

site/src/api/api.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
/**
2+
* @fileoverview This file is imported externally by things like vscode-coder so
3+
* it must not import anything using aliases otherwise it will break when being
4+
* imported by those external consumers. For example, `utils/delay` must be
5+
* imported using `../utils/delay` instead.
6+
*/
7+
18
import axios, { isAxiosError } from "axios";
29
import type dayjs from "dayjs";
310
import userAgentParser from "ua-parser-js";
4-
import { delay } from "utils/delay";
11+
import { delay } from "../utils/delay";
512
import * as TypesGen from "./typesGenerated";
6-
// This needs to include the `../`, otherwise it breaks when importing into
7-
// vscode-coder.
813

914
// Adds 304 for the default axios validateStatus function
1015
// https://github.com/axios/axios#handling-errors Check status here

0 commit comments

Comments
 (0)