{"id":25619664,"url":"https://github.com/danoc/next.js-async-listener-reproduction","last_synced_at":"2026-06-13T20:01:35.684Z","repository":{"id":42628212,"uuid":"393099127","full_name":"danoc/next.js-async-listener-reproduction","owner":"danoc","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-08T01:16:49.000Z","size":161,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-06T03:22:42.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-05T15:52:09.000Z","updated_at":"2021-08-05T16:56:03.000Z","dependencies_parsed_at":"2023-02-08T04:01:41.002Z","dependency_job_id":null,"html_url":"https://github.com/danoc/next.js-async-listener-reproduction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danoc/next.js-async-listener-reproduction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danoc%2Fnext.js-async-listener-reproduction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danoc%2Fnext.js-async-listener-reproduction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danoc%2Fnext.js-async-listener-reproduction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danoc%2Fnext.js-async-listener-reproduction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danoc","download_url":"https://codeload.github.com/danoc/next.js-async-listener-reproduction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danoc%2Fnext.js-async-listener-reproduction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34298255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-22T06:19:28.415Z","updated_at":"2026-06-13T20:01:35.637Z","avatar_url":"https://github.com/danoc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next.js-async-listener-reproduction\n\nThis is a minimal reproduction of an issue with Next.js, custom servers, Webpack 5, and `async-listener`. The corresponding issue is: https://github.com/vercel/next.js/issues/27792\n\n## Issue\n\n[Importing `aysnc-listener` in a custom Next.js server](https://github.com/danoc/next.js-async-listener-reproduction/blob/fe0ec92bdc64b1449257ff7c3410aa3327eeceec/server.js#L2) on a project that uses Webpack 5 will throw the following error:\n\n```\ninfo  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5\n(node:6406) UnhandledPromiseRejectionWarning: Error: Unexpected lazy element in stream\n    at readU8 (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:121549:11)\n    at BinaryMiddleware._deserialize (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:121842:20)\n    at BinaryMiddleware.deserialize (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:121454:15)\n    at Serializer.deserialize (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:123401:26)\n    at PackFileCacheStrategy._openPack (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:77661:5)\n    at new PackFileCacheStrategy (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:77633:27)\n    at WebpackOptionsApply.process (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:73976:9)\n    at createCompiler (~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:141356:28)\n    at ~/next-repro/node_modules/next/dist/compiled/webpack/bundle5.js:141319:48\n    at Array.map (\u003canonymous\u003e)\n(node:6406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)\n(node:6406) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.\n(node:6406) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '~/next-repro/.next/cache/webpack/client-development/index.pack'\n(node:6406) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)\n```\n\nI stumbled upon this when trying to integrate Next.js into a codebase that uses `zipkin-context-cls`. `zipkin-context-cls` depends on `continuation-local-storage` which itself depends on `async-listener`.\n\nThis fails with both Node 12 and 14.\n\n## Reproduction\n\nClone this codebase then:\n\n```bash\nyarn install\nnode server.js\n```\n\nNotice that commenting out [the problematic line](https://github.com/danoc/next.js-async-listener-reproduction/blob/aa9adc171aa03c38acede2a2f69a73e9f5204ce5/server.js#L2) or [using Webpack 4](https://github.com/danoc/next.js-async-listener-reproduction/blob/1e318279dbf25a61822e1195a0728571ae7bf72b/next.config.js#L3) makes the error go away. Also, this error only appears when `next({ dev: true })`. The issue does not appear in production builds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanoc%2Fnext.js-async-listener-reproduction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanoc%2Fnext.js-async-listener-reproduction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanoc%2Fnext.js-async-listener-reproduction/lists"}