Skip to content

fix(instrumentation): remove process.once Edge warnings - #1264

Closed
puxiao wants to merge 3 commits into
THU-MAIC:mainfrom
puxiao:fix/instrumentation-edge-process-once
Closed

fix(instrumentation): remove process.once Edge warnings#1264
puxiao wants to merge 3 commits into
THU-MAIC:mainfrom
puxiao:fix/instrumentation-edge-process-once

Conversation

@puxiao

@puxiao puxiao commented Aug 28, 2026

Copy link
Copy Markdown

Summary

This removes two build-time Edge warnings that occur during pnpm dev, while preserving the existing Node-side shutdown behavior.

Related Issues

Fixes #1262

Changes

  • Add lib/server/shutdown-signals.ts with registerShutdownSignals(shutdown).
  • In instrumentation.ts, replace the inline process.once calls with a dynamic import and call:
    await import('@/lib/server/shutdown-signals')registerShutdownSignals(shutdown).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or build changes

Verification

Steps to reproduce / test

  1. Run pnpm dev — before the fix, this triggered two warnings at instrumentation.ts
  2. After the fix, pnpm dev runs without the warnings, and pnpm build remains unaffected.

@wyuc
wyuc requested a review from LING-6150 August 28, 2026 07:44

@LING-6150 LING-6150 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused patch. The implementation itself looks appropriately scoped, and I don’t have any code-level blockers.
Before merging, please correct the PR title/body and #1262 so they match the observed behavior.
With Next.js 16.1.2, the inline process.once calls produce two Edge Runtime warnings, but next build still completes successfully with exit code 0. This patch removes those warnings; it does not fix a compile failure.
I also reproduced the warnings with a Node-runtime proxy.ts and an empty Edge middleware manifest, so having an explicit Edge runtime entry is not a required condition.
Please update:

  • The PR title and summary to describe removing Edge build warnings rather than fixing a compile failure.
  • The verification section to state that the build succeeds before and after the patch.
  • #1262’s title/body and reproduction conditions accordingly.
  • The malformed Closes #1262" reference.
    An accurate framing would be: this removes two build-time Edge warnings while preserving the existing Node-side shutdown behavior. In addition, please also modify the title as "fix(instrumentation): remove process.once Edge warnings" .
    No code changes are requested.

@puxiao puxiao changed the title fix(instrumentation): isolate process.once shutdown hooks from Edge b… fix(instrumentation): remove process.once Edge warnings Aug 28, 2026
@puxiao
puxiao requested a review from LING-6150 August 28, 2026 20:04
@LING-6150 LING-6150 closed this Aug 29, 2026
@LING-6150

Copy link
Copy Markdown
Collaborator

Thanks for addressing the review feedback so promptly. I’ve confirmed that this patch removes the two non-blocking Edge warnings while preserving the existing Node-side behavior.
After considering the maintenance tradeoff, we don’t plan to take a warning-only cleanup with no functional or user-facing impact at this time. The build already succeeds without this change, so I’m going to close the PR.
We can revisit this if the warning becomes blocking or needs to be addressed as part of a broader Next.js upgrade. Thanks again for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: running pnpm dev triggers two warnings at instrumentation.ts.

2 participants