felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.31k stars 362 forks source link

Hono 4.6.9: Cannot read private member #errorHandler #843

Open smoothdvd opened 1 day ago

smoothdvd commented 1 day ago
../../node_modules/.pnpm/hono@4.6.9/node_modules/hono/dist/hono-base.js (91:1) @ eval
 ⨯ TypeError: Cannot read private member #errorHandler from an object whose class did not declare it
    at Array.map (<anonymous>)
    at route (webpack:///src/app/bull-board/[[...index]]/route.ts?c746:27:4)
    at (rsc)/./src/app/bull-board/[[...index]]/route.ts (/Users/alexgao/Dev/dms/apps/api/.next/server/app/bull-board/[[...index]]/route.js:405:1)
image

I use hono in nextjs 15 like this

const app = new Hono()

// Create the Express adapter
const serverAdapter = new HonoAdapter(serveStatic)

// Create Bull Board with your queues
createBullBoard({
  queues: [
    new BullMQAdapter(getNewspaperArticleEmbedQueue()),
    new BullMQAdapter(getNewspaperPhotoEmbedQueue()),
  ],
  serverAdapter,
})

// Configure the server adapter
serverAdapter.setBasePath('/bull-board')
app.route('/bull-board', serverAdapter.registerPlugin())

rollback to hono 4.6.8, there is no issue anymore

felixmosh commented 1 day ago

Hi, thank you for reporting this issue. There is no official Next.js support, but if you willing to make a PR that solves this issue, I'll more than happy to review it :]

smoothdvd commented 1 day ago

Maybe cause by this Hono 4.6.9 update: refactor: use # for private methods to reduce the minified file size by @yusukebe in https://github.com/honojs/hono/pull/3596

stephencoffey commented 10 hours ago

Not using nextJs, but seeing the same error with 6.3.3 and @hono/node-server. Pinning hono to 4.6.8 fixes the problem. Agree with @smoothdvd that it's likely caused by https://github.com/honojs/hono/pull/3596

felixmosh commented 9 hours ago

Hi @stephencoffey can you share a small repo that reproduces the issue? Where is the code that tries to touch Hono's private members?