Skip to content

Commit

Permalink
Surface error occurring during import of @parcel/watcher (#9580)
Browse files Browse the repository at this point in the history
* Surface error occurring during import of @parcel/watcher

Follow up from #9506

* Add changeset

* Improve message and docs

* due to

* prettier
  • Loading branch information
spawnia authored Oct 12, 2023
1 parent 58d28a7 commit 50253b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-seahorses-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

Surface error occurring during import of @parcel/watcher
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/src/utils/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const createWatcher = (
parcelWatcher = await import('@parcel/watcher');
} catch (err) {
log(
`Parcel watcher not found. To use this feature, please make sure to provide @parcel/watcher as a peer dependency.`
`Failed to import @parcel/watcher due to the following error (to use watch mode, install https://www.npmjs.com/package/@parcel/watcher):\n${err}`
);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It's also helpful to run the codegen during your continuous integration flow and
<Callout type="info">
Watch mode was made optional to reduce install size in CI and prevent build errors in certain environments.

To use watch mode, make sure to provide `@parcel/watcher` as a peer dependency.
To use watch mode, install [`@parcel/watcher`](https://www.npmjs.com/package/@parcel/watcher).

</Callout>

Expand Down

0 comments on commit 50253b1

Please sign in to comment.