-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: ensure console.log()s during startup are displayed
#4235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: a51f57a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6625281192/npm-package-wrangler-4235You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6625281192/npm-package-wrangler-4235Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6625281192/npm-package-wrangler-4235 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6625281192/npm-package-cloudflare-pages-shared-4235Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
Codecov Report
@@ Coverage Diff @@
## main #4235 +/- ##
==========================================
- Coverage 75.41% 75.36% -0.05%
==========================================
Files 223 223
Lines 12231 12259 +28
Branches 3161 3171 +10
==========================================
+ Hits 9224 9239 +15
- Misses 3007 3020 +13
|
As of #4072, whenever Wrangler connected to the V8 inspector, it would clear V8's internal buffer of log messages. This ensured only messages logged while the inspector was connected would be displayed. Unfortunately, we only connect to the inspector once the Worker has reported it's ready to receive connections. This meant any `console.log()`s during Worker startup wouldn't be displayed. This change switches to clearing V8's buffer whenever we _disconnect_ from the inspector instead, ensuring startup logs are shown.
9fd7ed3 to
a51f57a
Compare
Fixes remix-run/remix#7616
What this PR solves / how to test:
As of #4072, whenever Wrangler connected to the V8 inspector, it would clear V8's internal buffer of log messages. This ensured only messages logged while the inspector was connected would be displayed. Unfortunately, we only connect to the inspector once the Worker has reported it's ready to receive connections. This meant any
console.log()s during Worker startup wouldn't be displayed.This change switches to clearing V8's buffer whenever we disconnect from the inspector instead, ensuring startup logs are shown. In particular, this should fix Remix's HMR, which relies on startup logs to know when the Worker is ready.
Associated docs issue(s)/PR(s):
N/A
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr reviewso future reviewers can take inspiration and learn from it.