Skip to content

Commit

Permalink
fix: Skip cfFetch if there are no functions during pages dev (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee authored May 31, 2022
1 parent ea8f8d7 commit e452a35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-numbers-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: Skip cfFetch if there are no functions during pages dev
3 changes: 3 additions & 0 deletions packages/wrangler/src/pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,9 @@ export const pages: BuilderCallback<unknown, unknown> = (yargs) => {
} else {
logger.log("No functions. Shimming...");
miniflareArgs = {
// cfFetch sets the `cf` object that a function could expect
// If there are no functions, there's no reason to set this up (and not make that network call)
cfFetch: false,
// TODO: The fact that these request/response hacks are necessary is ridiculous.
// We need to eliminate them from env.ASSETS.fetch (not sure if just local or prod as well)
script: `
Expand Down

0 comments on commit e452a35

Please sign in to comment.