-
Notifications
You must be signed in to change notification settings - Fork 658
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
Conversation
|
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 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.
| Please ensure constraints are pinned, and |
03c0da6
to
04662e2
Compare
Codecov Report
@@ 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 |
There was a problem hiding this 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
.
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:
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.