Skip to content

Commit

Permalink
Improve astro add deps error reporting (#9593)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Jan 4, 2024
1 parent 82bad5d commit 3b4e629
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-socks-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Improves `astro add` error reporting when the dependencies fail to install
5 changes: 3 additions & 2 deletions packages/astro/src/cli/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,12 @@ async function tryToInstallIntegrations({
);
spinner.succeed();
return UpdateResult.updated;
} catch (err) {
} catch (err: any) {
spinner.fail();
logger.debug('add', 'Error installing dependencies', err);
// NOTE: `err.stdout` can be an empty string, so log the full error instead for a more helpful log
// eslint-disable-next-line no-console
console.error('\n', (err as any).stdout, '\n');
console.error('\n', err.stdout || err.message, '\n');
return UpdateResult.failure;
}
} else {
Expand Down

0 comments on commit 3b4e629

Please sign in to comment.