Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve astro add deps error reporting #9593

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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