-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure
console.log()
s during startup are displayed (#4235)
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.
- Loading branch information
Showing
5 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: ensure `console.log()`s during startup are displayed | ||
|
||
Previously, `console.log()` calls before the Workers runtime was ready to | ||
receive requests wouldn't be shown. This meant any logs in the global scope | ||
likely weren't visible. This change ensures startup logs are shown. In particular, | ||
this should [fix Remix's HMR](https://github.com/remix-run/remix/issues/7616), | ||
which relies on startup logs to know when the Worker is ready. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters