graphile / starter

Opinionated SaaS quick-start with pre-built user account and organization system for full-stack application development in React, Node.js, GraphQL and PostgreSQL. Powered by PostGraphile, TypeScript, Apollo Client, Graphile Worker, Graphile Migrate, GraphQL Code Generator, Ant Design and Next.js
https://graphile-starter.herokuapp.com
Other
1.74k stars 219 forks source link

Error when trying to add postgraphile-plugin-connection-filter to graphile-starter 4.0 #269

Closed jamesallain closed 3 years ago

jamesallain commented 3 years ago

Hey Benjie! I think there's a little dependency issue here.

Summary

I'm trying to upgrade to 4.0. Got this this error error An unexpected error occurred: "expected workspace package to exist for \"inquirer\"". when trying add postgraphile-plugin-connection-filter to server folder.

Steps to reproduce

yarn add postgraphile-plugin-connection-filter to server folder

Expected results

Able to run yarn add postgraphile-plugin-connection-filter in server folder

Actual results

error An unexpected error occurred: "expected workspace package to exist for \"inquirer\"".

Additional context

Possible Solution

Works when downgrading to inquirer@7.1.0, which was the version used in graphile-starter 3.

benjie commented 3 years ago

Hey @jamesallain; try removing yarn.lock and trying again. Failing that, try adding the inquirer dependency explicitly to the relevant package.json and running yarn manually (rather than yarn add). Basically you've found a (quite common) bug in yarn 1 and it's really annoying to solve... :grimacing:

jamesallain commented 3 years ago

You're right, it's a yarn issue. I used an older version like this npx yarn@1.19.0 add postgraphile-plugin-connection-filter and it worked. Sorry about that, I thought I had found a bug 😳.

benjie commented 3 years ago

No worries!