Skip to content

Commit

Permalink
Fix [astro add] fetch failure (#4703)
Browse files Browse the repository at this point in the history
* fix: apply fetch polyfill earlier

* chore: changeset
  • Loading branch information
bholmesdev authored Sep 9, 2022
1 parent f226b67 commit d28f701
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-dingos-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix: [astro add] Apply fetch polyfill before running
2 changes: 1 addition & 1 deletion packages/astro/src/core/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const OFFICIAL_ADAPTER_TO_IMPORT_MAP: Record<string, string> = {
};

export default async function add(names: string[], { cwd, flags, logging, telemetry }: AddOptions) {
applyPolyfill();
if (flags.help || names.length === 0) {
printHelp({
commandName: 'astro add',
Expand Down Expand Up @@ -159,7 +160,6 @@ export default async function add(names: string[], { cwd, flags, logging, teleme

const rawConfigPath = await resolveConfigPath({ cwd, flags });
let configURL = rawConfigPath ? pathToFileURL(rawConfigPath) : undefined;
applyPolyfill();

if (configURL) {
debug('add', `Found config at ${configURL}`);
Expand Down

0 comments on commit d28f701

Please sign in to comment.