[fix] support and pin undici 5.12.0 - #7412
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
|
| /** @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.
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.
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 testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0