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

Could not resolve "apollo-server-errors" with esbuild #284

Open
crespowang opened this issue Jan 17, 2025 · 0 comments
Open

Could not resolve "apollo-server-errors" with esbuild #284

crespowang opened this issue Jan 17, 2025 · 0 comments

Comments

@crespowang
Copy link

Hello, I've been migrating our build system from webpack to esbuild, I am getting this error in build. I understand apollo-server-errors is not more in apolloServer v4, and we also don't use apolloServer v4, so is it safe for me to mark the path "apollo-server-errors" as external?

Thanks

✘ [ERROR] Could not resolve "apollo-server-errors"

node_modules/graphql-constraint-directive/index.js:192:49:
  192 │               const { UserInputError } = require('apollo-server-errors')
      ╵                                                  ~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "apollo-server-errors" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle. You can also surround this
"require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

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