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

Error: Cannot find module 'prettier' #8

Open
m-leon opened this issue Apr 1, 2021 · 2 comments
Open

Error: Cannot find module 'prettier' #8

m-leon opened this issue Apr 1, 2021 · 2 comments

Comments

@m-leon
Copy link

m-leon commented Apr 1, 2021

When using this package without installing prettier as a dependency, this package will throw an error:

Error: Cannot find module 'prettier'
Require stack:

  • /Users/mleon/Workspace/playground/api/node_modules/nexus-federation-plugin/dist/nexus-federation-plugin.cjs.development.js
    ...

I can provide the code of the project upon request.

Possible solutions are either move prettier from devDependencies to dependencies or remove the usage of prettier in the 'printTransformedSchema' function.

@m-leon
Copy link
Author

m-leon commented Apr 1, 2021

Nexus has an interesting approach to this as well:
https://github.com/graphql-nexus/nexus/blob/main/src/typegenFormatPrettier.ts

@m-leon
Copy link
Author

m-leon commented Apr 6, 2021

I'm happy to create a pull request with any of these solutions if I can get feedback with what method is preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant