graphiql: Can't resolve `graphql-ws` from `@graphiql/toolkit/esm/create-fetcher`
Seems like the recent release of @graphiql/toolkit has broken some of our tests. Maybe due to a missing dependency?
Module not found: Error: Can't resolve 'graphql-ws' in '/tmp/backstage-e2e-Z2eQgF/test-app/node_modules/@graphiql/toolkit/esm/create-fetcher'
error Command failed with exit code 1.
From https://github.com/backstage/backstage/runs/6420680730?check_suite_focus=true
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (6 by maintainers)
Commits related to this issue
- Added graphql-ws to work around issue https://github.com/graphql/graphiql/issues/2405 — committed to BuidlGuidl/scaffold-eth by mikery 5 years ago
The issue still exists. You did not remove the “top-level import” of peer dependency 😐
Iam using my own
fetchmethod, but still getting the error of missing dependency.Sure - I can take a look at this tomorrow.
@thomasheyenbrock, thinking the dynamic import is probably nicer right? not sure theres a need for multiple packages if we can do it in transparent way.
@thomasheyenbrock maybe it does make sense to add
graphql-wsas a required dependency of the packages that consume it directly and don’t have a nice fallback or handling if it’s not installed. Wondering if some of the moving around of code from #2401 made the library a required dependency now, and maybe because of the monorepo setup that the repo has, these issues don’t present themselves until installed as separate packages standalone as a lot of packages get hoisted and node really doesn’t care how something found itself intonode_modulesproviding it exists. We have pretty much the same setup withworkspacesandchangesetsas this repo, and we’ve been bitten by it a few times and had to enforce lint rules to try and catch stuff like this in CI.