From 551daba3c91d3bb966a35441037d2698952b4331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Sat, 24 Feb 2024 15:41:25 +0100 Subject: [PATCH] fix: missing createError imports --- src/runtime/server/utils/analytics.ts | 1 + src/runtime/server/utils/blob.ts | 2 +- src/runtime/server/utils/database.ts | 1 + src/runtime/server/utils/kv.ts | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/server/utils/analytics.ts b/src/runtime/server/utils/analytics.ts index 2130c66b..97626429 100644 --- a/src/runtime/server/utils/analytics.ts +++ b/src/runtime/server/utils/analytics.ts @@ -1,6 +1,7 @@ import type { AnalyticsEngineDataPoint, AnalyticsEngineDataset } from '@cloudflare/workers-types/experimental' import { ofetch } from 'ofetch' import { joinURL } from 'ufo' +import { createError } from 'h3' import { useRuntimeConfig } from '#imports' const _datasets: Record = {} diff --git a/src/runtime/server/utils/blob.ts b/src/runtime/server/utils/blob.ts index 76b18a56..6b383ce2 100644 --- a/src/runtime/server/utils/blob.ts +++ b/src/runtime/server/utils/blob.ts @@ -4,7 +4,7 @@ import type { R2Bucket } from '@cloudflare/workers-types/experimental' import { ofetch } from 'ofetch' import mime from 'mime' import type { H3Event } from 'h3' -import { setHeader } from 'h3' +import { setHeader, createError } from 'h3' import { defu } from 'defu' import { randomUUID } from 'uncrypto' import { parse } from 'pathe' diff --git a/src/runtime/server/utils/database.ts b/src/runtime/server/utils/database.ts index b9a63d3d..bbb2a1c1 100644 --- a/src/runtime/server/utils/database.ts +++ b/src/runtime/server/utils/database.ts @@ -1,6 +1,7 @@ import type { D1Database } from '@cloudflare/workers-types/experimental' import { ofetch } from 'ofetch' import { joinURL } from 'ufo' +import { createError } from 'h3' import type { H3Error } from 'h3' import { useRuntimeConfig } from '#imports' diff --git a/src/runtime/server/utils/kv.ts b/src/runtime/server/utils/kv.ts index 9c08abc7..59e7e59f 100644 --- a/src/runtime/server/utils/kv.ts +++ b/src/runtime/server/utils/kv.ts @@ -3,6 +3,7 @@ import { createStorage } from 'unstorage' import httpDriver from 'unstorage/drivers/http' import cloudflareKVBindingDriver from 'unstorage/drivers/cloudflare-kv-binding' import { joinURL } from 'ufo' +import { createError } from 'h3' import { useRuntimeConfig } from '#imports' let _kv: Storage