diff --git a/.changeset/tasty-snails-protect.md b/.changeset/tasty-snails-protect.md new file mode 100644 index 0000000000..cbd945ca0d --- /dev/null +++ b/.changeset/tasty-snails-protect.md @@ -0,0 +1,5 @@ +--- +"@astrojs/internal-helpers": patch +--- + +Fixes usage of `fileURLToPath()` to anticipate the changed signature of this method in Node 22.1.0 diff --git a/packages/internal-helpers/src/fs.ts b/packages/internal-helpers/src/fs.ts index c9f27810ad..5630040bbe 100644 --- a/packages/internal-helpers/src/fs.ts +++ b/packages/internal-helpers/src/fs.ts @@ -45,8 +45,8 @@ export async function copyFilesToFolder( outDir: URL, exclude: URL[] = [], ): Promise { - const excludeList = exclude.map(fileURLToPath); - const fileList = files.map(fileURLToPath).filter((f) => !excludeList.includes(f)); + const excludeList = exclude.map((url) => fileURLToPath(url)); + const fileList = files.map((url) => fileURLToPath(url)).filter((f) => !excludeList.includes(f)); if (files.length === 0) throw new Error('No files found to copy');