Fix veFaaS deploy bundle proxy-agent resolution - #66
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6e56e5ff0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| run([BUN, "build", "--target=node", "--packages=bundle", "--outfile", str(package_dir / "app.js"), str(ROOT / "apps/control-plane-api/src/index.ts")]) | ||
| run([BUN, "build", "--target=node", "--packages=bundle", "--outfile", str(package_dir / "mysql_child.mjs"), str(ROOT / "apps/control-plane-api/src/infra/mysql_child.mjs")]) | ||
| run([BUN, "build", "--target=node", "--packages=bundle", "--outfile", str(package_dir / "mysql_worker.mjs"), str(ROOT / "apps/control-plane-api/src/infra/mysql_worker.mjs")]) | ||
| backend_build = [BUN, "build", "--target=node", "--packages=bundle", "--external=proxy-agent"] |
There was a problem hiding this comment.
Ship proxy-agent when externalizing it
With --external=proxy-agent, Bun leaves a runtime require("proxy-agent") in the backend bundle instead of bundling that optional urllib peer. The veFaaS package this script uploads does not include node_modules and writes a root package.json containing only name/private before run.sh executes node app.js, so any proxy-enabled ali-oss/urllib path will fail in the deployed function with MODULE_NOT_FOUND for proxy-agent. Please either bundle/install proxy-agent in the uploaded backend package or avoid externalizing a dependency that may be required at runtime.
Useful? React with 👍 / 👎.
Summary
Verification
Note: this addresses the current main Cloud Deploy failure where Bun could not resolve urllib's optional peer dependency: proxy-agent.