Skip to content

Commit

Permalink
fix: add a helpful message on Windows when Miniflare fails to start (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin authored Aug 15, 2024
1 parent 83083d7 commit 0d85f24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-steaks-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: add a helpful message on Windows when Miniflare fails to start
9 changes: 9 additions & 0 deletions packages/wrangler/src/dev/local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ function useLocalWorker(props: LocalProps) {
"code" in error &&
(error as { code: string }).code === "ERR_RUNTIME_FAILURE"
) {
// In the past we have seen Access Violation errors on Windows, which may be caused by an outdated
// version of the Microsoft Visual C++ Redistributable.
// See https://github.com/cloudflare/workers-sdk/issues/6170#issuecomment-2245209918
if (process.platform === "win32") {
logger.error(
"Check that you have the latest Microsoft Visual C++ Redistributable library installed.\n" +
"See https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist."
);
}
// Don't log a full verbose stack-trace when Miniflare 3's workerd instance fails to start.
// workerd will log its own errors, and our stack trace won't have any useful information.
logger.error(String(error));
Expand Down

0 comments on commit 0d85f24

Please sign in to comment.