Fix [astro add]
fetch failure (#4703)
* fix: apply fetch polyfill earlier * chore: changeset
This commit is contained in:
parent
f226b677b8
commit
d28f7013c2
2 changed files with 6 additions and 1 deletions
5
.changeset/mean-dingos-juggle.md
Normal file
5
.changeset/mean-dingos-juggle.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix: [astro add] Apply fetch polyfill before running
|
|
@ -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',
|
||||
|
@ -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}`);
|
||||
|
|
Loading…
Reference in a new issue