Skip to content

Commit 157c823

Browse files
authored
CODEGEN-787 - Improve handling of missing @parcel/watcher scenario (#10358)
* Remove error stacktrace when watcher is missing * Add changeset * Use warn instead of log * Revert warn usage as it is the same for users. Improve message
1 parent a4acc9e commit 157c823

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/tidy-cows-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/cli': patch
3+
---
4+
5+
Remove extraneous error stacktrace if fails to load `@parcel/watcher`

packages/graphql-codegen-cli/src/utils/watcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ export const createWatcher = (
6464
let parcelWatcher: typeof import('@parcel/watcher');
6565
try {
6666
parcelWatcher = await import('@parcel/watcher');
67-
} catch (err) {
67+
} catch {
6868
log(
69-
`Failed to import @parcel/watcher due to the following error (to use watch mode, install https://www.npmjs.com/package/@parcel/watcher):\n${err}`
69+
'Failed to import @parcel/watcher.\n To use watch mode, install https://www.npmjs.com/package/@parcel/watcher.'
7070
);
7171
return;
7272
}

0 commit comments

Comments
 (0)