From b712a2f05f79087c27a05c80fff3a5e71d382551 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 3 Jul 2023 16:29:07 +0800 Subject: [PATCH] Minor fixes --- packages/astro/src/vite-plugin-astro-server/request.ts | 2 +- packages/integrations/image/src/vendor/squoosh/impl.ts | 4 ++-- packages/integrations/markdoc/src/content-entry-type.ts | 1 - packages/integrations/mdx/src/plugins.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/astro/src/vite-plugin-astro-server/request.ts b/packages/astro/src/vite-plugin-astro-server/request.ts index afc8e798939e..21599064c7c2 100644 --- a/packages/astro/src/vite-plugin-astro-server/request.ts +++ b/packages/astro/src/vite-plugin-astro-server/request.ts @@ -84,7 +84,7 @@ export async function handleRequest( // This could be a runtime error from Vite's SSR module, so try to fix it here try { - env.loader.fixStacktrace(err ); + env.loader.fixStacktrace(err); } catch {} // This is our last line of defense regarding errors where we still might have some information about the request diff --git a/packages/integrations/image/src/vendor/squoosh/impl.ts b/packages/integrations/image/src/vendor/squoosh/impl.ts index 655c309f45a7..4c57730f7372 100644 --- a/packages/integrations/image/src/vendor/squoosh/impl.ts +++ b/packages/integrations/image/src/vendor/squoosh/impl.ts @@ -65,7 +65,7 @@ export async function resize({ image, width, height }: ResizeOpts) { const p = preprocessors['resize'] const m = await p.instantiate() await maybeDelay() - return m(image.data, image.width, image.height, { + return await m(image.data, image.width, image.height, { ...p.defaultOptions, width, height, @@ -82,7 +82,7 @@ export async function encodeJpeg( const m = await e.enc() await maybeDelay() const quality = opts.quality || e.defaultEncoderOptions.quality - const r = m.encode(image.data, image.width, image.height, { + const r = await m.encode(image.data, image.width, image.height, { ...e.defaultEncoderOptions, quality, }) diff --git a/packages/integrations/markdoc/src/content-entry-type.ts b/packages/integrations/markdoc/src/content-entry-type.ts index af277ff8a992..2bae5402cd4b 100644 --- a/packages/integrations/markdoc/src/content-entry-type.ts +++ b/packages/integrations/markdoc/src/content-entry-type.ts @@ -1,4 +1,3 @@ - import type { Config as MarkdocConfig, Node } from '@markdoc/markdoc'; import Markdoc from '@markdoc/markdoc'; import type { AstroConfig, ContentEntryType } from 'astro'; diff --git a/packages/integrations/mdx/src/plugins.ts b/packages/integrations/mdx/src/plugins.ts index ae012d337b2e..ed03f4b2b82b 100644 --- a/packages/integrations/mdx/src/plugins.ts +++ b/packages/integrations/mdx/src/plugins.ts @@ -33,7 +33,7 @@ export function recmaInjectImportMetaEnvPlugin({ estreeVisit(tree, (node) => { if (node.type === 'MemberExpression') { // attempt to get "import.meta.env" variable name - const envVarName = getImportMetaEnvVariableName(node ); + const envVarName = getImportMetaEnvVariableName(node); if (typeof envVarName === 'string') { // clear object keys to replace with envVarLiteral for (const key in node) {