danielwaltz / vite-plugin-graphql-codegen

Zero-config vite plugin that uses the vite file watcher to run graphql codegen programmatically without needing to start a separate watcher
https://www.npmjs.com/package/vite-plugin-graphql-codegen
MIT License
83 stars 7 forks source link

Config load failure when used with Yarn PnP #22

Closed jnoordsij closed 1 year ago

jnoordsij commented 1 year ago

When running a Vite build with Yarn PnP mode enabled (see https://v3.yarnpkg.com/features/pnp), I ran into the following error:

failed to load config from ...\vite.config.ts
error during build:
Error: vite-plugin-graphql-codegen tried to access @graphql-codegen/plugin-helpers, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Given the usage of this package in src/utils/configPaths.ts, Yarn PnP requires adding the dependency explicitly.

Solution: @graphql-codegen/plugin-helpers should be added either as dependency or peerDependency to package.json.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.2.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

danielwaltz commented 1 year ago

Should be fixed now, thanks for letting me know!