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

Most upvoted comments

The issue still exists. You did not remove the “top-level import” of peer dependency 😐

Iam using my own fetch method, but still getting the error of missing dependency.

image

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-ws as 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 into node_modules providing it exists. We have pretty much the same setup with workspaces and changesets as 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.