diff --git a/.changeset/plenty-seahorses-laugh.md b/.changeset/plenty-seahorses-laugh.md new file mode 100644 index 00000000000..5bbde66ae4d --- /dev/null +++ b/.changeset/plenty-seahorses-laugh.md @@ -0,0 +1,5 @@ +--- +'@graphql-codegen/cli': patch +--- + +Surface error occurring during import of @parcel/watcher diff --git a/packages/graphql-codegen-cli/src/utils/watcher.ts b/packages/graphql-codegen-cli/src/utils/watcher.ts index bef6702414d..043e88d8dff 100644 --- a/packages/graphql-codegen-cli/src/utils/watcher.ts +++ b/packages/graphql-codegen-cli/src/utils/watcher.ts @@ -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; } diff --git a/website/src/pages/docs/getting-started/development-workflow.mdx b/website/src/pages/docs/getting-started/development-workflow.mdx index a0885609b02..54dd33ca3aa 100644 --- a/website/src/pages/docs/getting-started/development-workflow.mdx +++ b/website/src/pages/docs/getting-started/development-workflow.mdx @@ -33,7 +33,7 @@ It's also helpful to run the codegen during your continuous integration flow and 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).