Skip to content

🐛 BUG: You can mark the path <pathname> as external is not an actionable error message #7095

@irvinebroque

Description

@irvinebroque

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.81.0

What version of Node are you using?

22

What operating system and version are you using?

14.7

Describe the Bug

Any time you hit an error like this:

✘ [ERROR] Build failed with 3 errors:

  ✘ [ERROR] Could not resolve "graphql/language/visitor"
  
      node_modules/dd-trace/packages/datadog-plugin-graphql/src/tools/transforms.js:9:26:
        9 │ const visitor_1 = require("graphql/language/visitor");

...we give you back the following error message from esbuild:

    You can mark the path "graphql/language/visitor" as external to exclude it from the bundle,
  which will remove this error. You can also surround this "require" call with a try/catch block to
  handle this failure at run-time instead of bundle-time.

But if I then ask, "okay, how do I actually do this and mark the path as external?"

We can be clearer here. For example, we can guide people on how to use module aliasing #6231 (comment)

It also seems reasonable to consider if it makes sense to support the option to mark a module as external — but to start — how do we give back a more helpful error here that is more actionable and specific?

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-messagingImproving user facing error messages

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions