Skip to content

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

@crespowang

Description

@crespowang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions