From 2c07656c8d72c08dd6c2b9ddc1a5000ca1c55496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Alves?= <71379045+andremralves@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:25:59 -0300 Subject: [PATCH] Update config error message for `outDir` infinity loop error (#8220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Elian ☕️ Co-authored-by: Emanuele Stoppa --- packages/astro/src/core/config/schema.ts | 2 +- packages/astro/test/units/config/config-validate.test.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index e0ddeb268f..da737ebc0d 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -410,7 +410,7 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: string) { }) .refine((obj) => !obj.outDir.toString().startsWith(obj.publicDir.toString()), { message: - '`outDir` must not be placed inside `publicDir` to prevent an infinite loop. Please adjust the directory configuration and try again', + 'The value of `outDir` must not point to a path within the folder set as `publicDir`, this will cause an infinite loop', }); return AstroConfigRelativeSchema; diff --git a/packages/astro/test/units/config/config-validate.test.js b/packages/astro/test/units/config/config-validate.test.js index 604836747d..48088468ae 100644 --- a/packages/astro/test/units/config/config-validate.test.js +++ b/packages/astro/test/units/config/config-validate.test.js @@ -74,8 +74,7 @@ describe('Config Validation', () => { ); expect(configError instanceof z.ZodError).to.equal(true); expect(configError.errors[0].message).to.equal( - '`outDir` must not be placed inside `publicDir` to prevent an infinite loop. \ -Please adjust the directory configuration and try again' + 'The value of `outDir` must not point to a path within the folder set as `publicDir`, this will cause an infinite loop' ); }); });