-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[fix] support and pin undici 5.12.0 #7412
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
Conversation
🦋 Changeset detectedLatest commit: 7873c25 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Not to knock your fix (it's a good one) but wouldn't a more stable fix be to pin to the last known good version of undici (5.11.0)? |
There are many fixes and improvements in 5.12.0. |
Worked like a charm for me. Thanks repsac-by |
The Undici team indicated this is the correct fix
|
@@ -95,6 +95,8 @@ function get_raw_body(req, body_size_limit) { | |||
/** @type {import('@sveltejs/kit/node').getRequest} */ | |||
export async function getRequest({ request, base, bodySizeLimit }) { | |||
return new Request(base + request.url, { | |||
// @ts-expect-error |
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.
I would expect we shouldn't need this. Is there some detail we can add here about how/when we might be able to remove it. Are the types provided by Typescript or Undici? Is there and open issue we can link to or can we file a new one?
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.
These types appear to be coming from TS, not from undici. Locally, even when I updated the Kit repo to undici 5.12.0, TS still complained about the duplex
.
The undici PR included updates to the types here (https://github.com/nodejs/undici/pull/1681/files#diff-cfe294cd3fb885afcce564fae32dd1524399460a9a04f141e07bb45858a47f92), but it looks like we're not using those. I tries this out locally (and updated the Kit repo to undici 5.12.0), but the types for This change looks good to me. Can we get a changeset? |
We should probably pin the Undici version as well as they've indicated that it's experimental and may have breaking changes in minor/patch versions: nodejs/undici#1681 (comment) |
That sounds good to me as well. |
Fixes #7409
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0