Skip to content
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

[WIP] pages: Fix "worker called response.clone()" warnings in wrangler pages dev #4185

Closed
wants to merge 1 commit into from

Conversation

CarmenPopoviciu
Copy link
Contributor

@CarmenPopoviciu CarmenPopoviciu commented Oct 16, 2023

Fixes #3259

What this PR solves / how to test:
// TODO add proper description when out of WIP

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

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 review so future reviewers can take inspiration and learn from it.

@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2023

⚠️ No Changeset found

Latest commit: 04662e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

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/6534001661/npm-package-wrangler-4185

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6534001661/npm-package-wrangler-4185

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6534001661/npm-package-wrangler-4185 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6534001661/npm-package-cloudflare-pages-shared-4185

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231010.0 3.20231010.0
workerd 1.20231010.0 1.20231010.0
workerd --version 1.20231010.0 2023-10-10

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #4185 (04662e2) into main (36d4978) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4185      +/-   ##
==========================================
+ Coverage   75.37%   75.41%   +0.03%     
==========================================
  Files         223      223              
  Lines       12217    12217              
  Branches     3159     3159              
==========================================
+ Hits         9209     9213       +4     
+ Misses       3008     3004       -4     

see 3 files with indirect coverage changes

Copy link
Member

@GregBrimble GregBrimble left a comment

Choose a reason for hiding this comment

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

Don't think this can be merged, unfortunately.

<!-- public/index.html -->
<h1>Hello, world!</h1>
<form action="/submit" method="POST">
	<input type="text" name="name" placeholder="Enter your name" />
	<button type="submit">Submit</button>
</form>
// functions/_middleware.ts
export const onRequestPost = async ({ request, next }) => {
	const formData = await request.formData();
	console.log("Logging in middleware", Object.fromEntries(formData.entries()));
	return next();
};
// functions/submit.ts
export const onRequestPost = async ({ request }) => {
	const formData = await request.formData();
	return Response.json(Object.fromEntries(formData.entries()));
};

This errors with this prerelease but works with wrangler@latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Your worker called response.clone(), but did not read the body of both clones
2 participants