Title: Default Hono integration can terminate bundled Bun apps without Hono on read-only filesystems · Issue #25540 · getsentry/sentry-javascript · GitHub
Open Graph Title: Default Hono integration can terminate bundled Bun apps without Hono on read-only filesystems · Issue #25540 · getsentry/sentry-javascript
X Title: Default Hono integration can terminate bundled Bun apps without Hono on read-only filesystems · Issue #25540 · getsentry/sentry-javascript
Description: Summary Calling Sentry.init() with the default integrations in a bundled Bun application that does not use or install Hono can terminate the process on a restricted filesystem. The default Hono integration eagerly tries to require hono/b...
Open Graph Description: Summary Calling Sentry.init() with the default integrations in a bundled Bun application that does not use or install Hono can terminate the process on a restricted filesystem. The default Hono int...
X Description: Summary Calling Sentry.init() with the default integrations in a bundled Bun application that does not use or install Hono can terminate the process on a restricted filesystem. The default Hono int...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25540
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Default Hono integration can terminate bundled Bun apps without Hono on read-only filesystems","articleBody":"## Summary\n\nCalling `Sentry.init()` with the default integrations in a bundled Bun application that does **not** use or install Hono can terminate the process on a restricted filesystem. The default Hono integration eagerly tries to require `hono/bun`. Bun enters its runtime package-cache initialization path, fails to create the cache, and exits natively before the missing-module error can be caught.\n\nThis caused a production Vercel Bun function to fail at startup, including its health endpoint. No application framework or server is needed for the reproduction below.\n\n## Environment\n\n- Sentry SaaS\n- `@sentry/bun@11.8.0` (latest npm release when checked)\n- Also reproduced with `@sentry/node@11.8.0` running under Bun\n- Local reproduction: Bun 1.3.11, macOS 27.0, arm64\n- Original production failure: Vercel Bun runtime (`bunVersion: \"1.x\"`); exact production Bun patch version not captured\n- Bundler: `bun build --target=bun --format=esm`\n- Hono is not installed or used\n\n## Minimal SDK setup\n\nSave as `build/repro.ts`:\n\n```ts\nimport * as Sentry from \"@sentry/bun\";\n\nSentry.init({\n dsn: \"https://public@example.invalid/1\",\n tracesSampleRate: 0,\n integrations: (defaults) => process.env.WITHOUT_HONO === \"1\"\n ? defaults.filter((integration) => integration.name !== \"Hono\")\n : defaults,\n});\nconsole.log(\"Sentry initialized\");\nprocess.exit(0);\n```\n\nThe integrations callback returns the defaults unchanged unless `WITHOUT_HONO=1`; it exists only to demonstrate the one-variable control. The DSN is deliberately fake and no event is sent.\n\n## Steps to reproduce on macOS\n\nUse a new temporary directory outside an existing project. Build and runtime directories must be siblings so the runtime has no ancestor `node_modules` directory.\n\n```sh\nrepro_root=$(mktemp -d /tmp/sentry-hono-repro.XXXXXX)\nmkdir \"$repro_root/build\" \"$repro_root/runtime\"\n# Save the TypeScript above as \"$repro_root/build/repro.ts\".\ncat > \"$repro_root/build/package.json\" \u003c\u003c'JSON'\n{\"private\":true,\"type\":\"module\",\"dependencies\":{\"@sentry/bun\":\"11.8.0\"}}\nJSON\nbun install --cwd \"$repro_root/build\"\nbun build \"$repro_root/build/repro.ts\" --target=bun --format=esm \\\n --outfile \"$repro_root/runtime/repro.mjs\"\ncd \"$repro_root/runtime\"\nexport BUN_INSTALL_CACHE_DIR=\"$repro_root/blocked-cache\"\nunset WITHOUT_HONO\n\n# Default integrations: exits 1 before printing \"Sentry initialized\".\nsandbox-exec -p '(version 1)(allow default)(deny file-write*)' bun repro.mjs\n\n# Same bundle and filesystem restrictions, only Hono removed: exits 0.\nWITHOUT_HONO=1 sandbox-exec -p '(version 1)(allow default)(deny file-write*)' \\\n bun repro.mjs\n\n# Default integrations, only Bun auto-install disabled: also exits 0.\nsandbox-exec -p '(version 1)(allow default)(deny file-write*)' \\\n bun --no-install repro.mjs\n```\n\n## Expected result\n\nAn application that does not use Hono should initialize successfully without trying to load/install Hono. An unavailable optional framework integration should be skipped without requiring filesystem writes.\n\n## Actual result\n\nDefault integrations, sandboxed macOS reproduction:\n\n```text\nerror: bun is unable to write files: PermissionDenied\n```\n\nProcess exit status: 1.\n\nProduction Vercel log:\n\n```text\nerror: bun is unable to write files: ReadOnlyFileSystem\nBun process exited with exit status: 1.\n```\n\nBoth controls print `Sentry initialized` and exit 0. macOS sandbox denial and Vercel's read-only mount yield different OS errors; the same Bun package-cache failure path is involved.\n\n## Isolation and source pointers\n\nUsing the exact original initialization options, both `@sentry/bun@11.8.0` and `@sentry/node@11.8.0` failed 3/3 runs under these restrictions. Filtering out only the integration named `Hono` made each SDK start 3/3 times. The standalone minimal example above was also tested with both controls.\n\n- Both SDKs include the Hono error integration in their defaults, even with tracing disabled.\n- [Bun/Deno eagerly invoke the integration callback](https://github.com/getsentry/sentry-javascript/blob/11.8.0/packages/server-utils/src/orchestrion/instrumentation.ts).\n- [`instrumentHono()` eagerly calls `resolveGetConnInfo()`, which requires `hono/bun` on Bun](https://github.com/getsentry/sentry-javascript/blob/11.8.0/packages/server-utils/src/integrations/hono/honoIntegration.ts).\n- [Bun's package-cache initialization falls back to creating `node_modules/.cache` and calls `Global.crash()` on failure](https://github.com/oven-sh/bun/blob/bun-v1.3.11/src/install/PackageManager/PackageManagerDirectories.zig#L122-L146).\n\nThe native process exit means the SDK's existing try/catch around the optional require cannot recover. Bun's fatal cache behavior is a related runtime issue; this report concerns the default Sentry integration triggering it in an application with no Hono dependency.\n\nSearching existing issues for `hono/bun` and Hono/cache did not reveal a matching report. The production app currently avoids this by removing server instrumentation; filtering Hono is a locally verified workaround, not a claim of full Vercel validation.\n","author":{"url":"https://github.com/winspoolnba","@type":"Person","name":"winspoolnba"},"datePublished":"2026-10-19T18:45:04Z","url":"https://github.com/getsentry/sentry-javascript/issues/25540"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bd80508e-f61c-e074-a586-f9b9d9f84469 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C90A:181C7:3A2D:4B24:6B04159F |
| html-safe-nonce | ad6cf4111ec5f408452a1a8e95bcb1f45e28c652a3256329bce52731923406d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTBBOjE4MUM3OjNBMkQ6NEIyNDo2QjA0MTU5RiIsInZpc2l0b3JfaWQiOiIxMzU3MjI3NTE3MjE1NTExOTY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a5ef9e0a6aa61a384028a462644be9b70904dcdc2609e4054d8a1907bad565f |
| hovercard-subject-tag | issue:5929540915 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25540/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8d60478823ead46b99a11daf6208d477c5d2c6dacd14932680fb592e966a5413/getsentry/sentry-javascript/issues/25540 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8d60478823ead46b99a11daf6208d477c5d2c6dacd14932680fb592e966a5413/getsentry/sentry-javascript/issues/25540 |
| og:image:alt | Summary Calling Sentry.init() with the default integrations in a bundled Bun application that does not use or install Hono can terminate the process on a restricted filesystem. The default Hono int... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | winspoolnba |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width