-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 BUG: You can mark the path <pathname> as external is not an actionable error message #7095
Copy link
Copy link
Closed
Bug
Copy link
Labels
error-messagingImproving user facing error messagesImproving user facing error messages
Description
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?"
- A Google search leads you here
- The Wrangler docs on bundling and configuration don't explain anything
- A search of
cloudflare/workers-sdkissues leads to 🚀 Feature Request: Esbuild External #6231 - ChatGPT gives misleading results that reference Webpack
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
error-messagingImproving user facing error messagesImproving user facing error messages
Type
Projects
Status
Done