Comments (13)
@KhafraDev Seems valid.
from undici.
@stefan-garofalo can you try to isolate what combination of response body + headers is causing this? In order to fix we need a server that reproduces the problem, otherwise it's impossible to find out.
Nothing really stands up by looking at the diffs.
from undici.
@stefan-garofalo can you try to isolate what combination of response body + headers is causing this? In order to fix we need a server that reproduces the problem, otherwise it's impossible to find out.
Nothing really stands up by looking at the diffs.
I managed to specifically install the latest node 22 version (22.3.0) locally and now I am actually reproducing the error outside of github workers too.
This is the response:
Response {
status: 200,
statusText: '',
headers: Headers {
'access-control-allow-headers': 'Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type',
'access-control-expose-headers': 'X-WP-Total, X-WP-TotalPages, Link',
allow: 'GET',
'content-type': 'application/json; charset=UTF-8',
date: 'Fri, 14 Jun 2024 09:30:02 GMT',
link: '<MY_CMS_URL>; rel="https://api.w.org/"',
server: 'Apache/2.4.59 (Debian)',
vary: 'Origin',
'x-content-type-options': 'nosniff',
'x-powered-by': 'PHP/8.2.19',
'x-robots-tag': 'noindex',
'x-wp-total': '1',
'x-wp-totalpages': '1',
'transfer-encoding': 'chunked'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: true,
redirected: false,
type: 'default',
url: 'MY_CMS_URL'
}
And here follows the body
[
{
"id": 13,
"date": "2024-05-29T11:49:34",
"date_gmt": "2024-05-29T09:49:34",
"guid": {
"rendered": "MY_CMS_URL"
},
"modified": "2024-06-13T17:35:54",
"modified_gmt": "2024-06-13T15:35:54",
"slug": "homepage",
"status": "publish",
"type": "page",
"link": "MY_CMS_URL",
"title": {
"rendered": "Homepage"
},
"content": {
"rendered": "",
"protected": false
},
"excerpt": {
"rendered": "",
"protected": false
},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 4,
"comment_status": "closed",
"ping_status": "closed",
"template": "",
"meta": {
"footnotes": ""
},
"acf": {
"hero": {
"titolo": "LOREM IPSUM DOLOR SIT AMET, CONSETETUR SADIPSCING ELITR SED DIAM",
"paragrafo": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
"cta": {
"etichetta": "lorem",
"link": "/"
}
},
"pagine": {
"lista": [49, 67]
},
"storie": {
"titolo": "Lorem",
"lista": [
{
"titolo": "Lorem ipsum dolor sit amet consetetur",
"cover": {
"ID": 44,
"id": 44,
"status": "inherit",
"uploaded_to": 13,
"date": "2024-05-30 15:24:42",
"modified": "2024-05-30 15:24:48",
"menu_order": 0,
"mime_type": "image/png",
"type": "image",
"subtype": "png",
"width": 1830,
"height": 1866,
"sizes": {
"thumbnail-width": 150,
"thumbnail-height": 150,
"medium-width": 294,
"medium-height": 300,
"medium_large-width": 768,
"medium_large-height": 783,
"large-width": 1004,
"large-height": 1024,
"1536x1536-width": 1506,
"1536x1536-height": 1536,
"2048x2048-width": 1830,
"2048x2048-height": 1866
}
},
"colore": "light"
},
{
"titolo": "Lorem ipsum dolor sit amet consetetur",
"cover": {
"ID": 44,
"id": 44,
"filesize": 89931,
"author": "1",
"uploaded_to": 13,
"date": "2024-05-30 15:24:42",
"modified": "2024-05-30 15:24:48",
"menu_order": 0,
"mime_type": "image/png",
"type": "image",
"subtype": "png",
"width": 1830,
"height": 1866,
"sizes": {
"thumbnail-width": 150,
"thumbnail-height": 150,
"medium-width": 294,
"medium-height": 300,
"medium_large-width": 768,
"medium_large-height": 783,
"large-width": 1004,
"large-height": 1024,
"1536x1536-width": 1506,
"1536x1536-height": 1536,
"2048x2048-width": 1830,
"2048x2048-height": 1866
}
},
"colore": "white"
},
{
"titolo": "Lorem ipsum dolor sit amet consetetur",
"cover": {
"ID": 44,
"id": 44,
"filesize": 89931,
"author": "1",
"status": "inherit",
"uploaded_to": 13,
"date": "2024-05-30 15:24:42",
"modified": "2024-05-30 15:24:48",
"menu_order": 0,
"mime_type": "image/png",
"type": "image",
"subtype": "png",
"width": 1830,
"height": 1866,
"sizes": {
"thumbnail-width": 150,
"thumbnail-height": 150,
"medium-width": 294,
"medium-height": 300,
"medium_large-width": 768,
"medium_large-height": 783,
"large-width": 1004,
"large-height": 1024,
"1536x1536-width": 1506,
"1536x1536-height": 1536,
"2048x2048-width": 1830,
"2048x2048-height": 1866
}
},
"colore": "secondary"
},
{
"titolo": "Lorem ipsum dolor sit amet consetetur",
"cover": {
"ID": 44,
"id": 44,
"filesize": 89931,
"author": "1",
"status": "inherit",
"uploaded_to": 13,
"date": "2024-05-30 15:24:42",
"modified": "2024-05-30 15:24:48",
"menu_order": 0,
"mime_type": "image/png",
"type": "image",
"subtype": "png",
"width": 1830,
"height": 1866,
"sizes": {
"thumbnail-width": 150,
"thumbnail-height": 150,
"medium-width": 294,
"medium-height": 300,
"medium_large": "MY_CMS_URL/wp-content/uploads/2024/05/logobuzzi-768x783.png",
"medium_large-width": 768,
"medium_large-height": 783,
"large-width": 1004,
"large-height": 1024,
"1536x1536-width": 1506,
"1536x1536-height": 1536,
"2048x2048-width": 1830,
"2048x2048-height": 1866
}
},
"colore": "light"
}
]
},
"buca": {
"titolo": "LOREM IPSUM DOLOR SIT AMET",
"paragrafo": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum."
},
"seo": {
"title": "Homepage",
"description": "Lorem ipsum dolor homepage",
"image": false
}
},
"_links": {
"self": [
{
"href": "MY_CMS_URL"
}
],
"collection": [
{
"href": "MY_CMS_URL"
}
],
"about": [
{
"href": "MY_CMS_URL"
}
],
"author": [
{
"embeddable": true,
"href": "MY_CMS_URL"
}
],
"replies": [
{
"embeddable": true,
"href": "MY_CMS_URL"
}
],
"version-history": [
{
"count": 9,
"href": "MY_CMS_URL"
}
],
"predecessor-version": [
{
"id": 204,
"href": "MY_CMS_URL"
}
],
"wp:attachment": [
{
"href": "MY_CMS_URL"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
]
awaiting response.text()
does not trigger any error, only json parsing. Parsing the response.text()
using any online parser still works indeed
from undici.
@stefan-garofalo can you include a complete example on reproducing it outside of GitHub Actions? Ideally client+server.
from undici.
@mcollina I tried to reproduce it. When asked to provide headers and body as you requested I did nvm use 22.3.0
and could reproduce it on my project on my machine. I updated the issue's description accordingly
from undici.
But I also failed to reproduce the issue outside of my current nextjs project. I tried node only with npm init
, I tried a new empty Nextjs app, but still not reproducible
from undici.
Keep going at it, without the reproduction will be impossible to fix :(.
- Is the new project talking to the same API of the old one?
- Are the versions of Next.js the same?
- Inside the "faulty" app, can you try installing undici directly and calling
require('undici').fetch()
?
from undici.
- In the new project I tried calling both the API used in the faulty example and the public pokemon API
- Nextjs versions are the same
- I tried calling
undici.fetch()
directly and it now works in the faulty scenario.
So I guess its not really about undici. Maybe some conflicts between fetch ad Nextjs patches? Should I reopen this issue in Nextjs repository?
from undici.
Possibly, we can investigate if we have a reproduction.
from undici.
I encountered similar issues: 22.3-alpine
failed, but after changing to 22.1-alpine
, it worked fine.
https://github.com/luuppiry/luuppi-next/actions/runs/9527152450/job/26263513613
https://github.com/luuppiry/luuppi-next/actions/runs/9527336924/job/26263847778
from undici.
We need a minimal reproduction to be able to fix.
from undici.
afaik nextjs patches fetch which likely causes the issue. Without more information it looks like they're not decompressing the body.
from undici.
The only PR that touched body was f979ec3, which would have landed in node v22 (undici v6.14.0). We can revert it to be safe, but without a reproduction... cc @tsctx
from undici.
Related Issues (20)
- Fetch failed with UND_ERR_CONNECT_TIMEOUT undici error on Next.js serverless function HOT 1
- 'interceptors' export doesn't work like in the docs HOT 1
- Nightly tests are failing HOT 4
- publish autobahn test results on the docs site HOT 7
- Nightly tests are failing HOT 2
- Improve support for pre-shared sessions (PSK) HOT 3
- Request constructor: Failed to parse URL from ___ HOT 2
- Broken links in docs webpage HOT 2
- undici/types/index.d.ts:21:8: Type error TS1192: Module '"[email protected]/node_modules/undici/types/interceptors"' has no default export HOT 6
- Node 22.3.0 regression: undici sends invalid origin header in some cases HOT 2
- fetch arrayBuffer() leaks random data from process memory HOT 14
- build: husky install is deprecated HOT 1
- Ability to externalize WASM was broken HOT 9
- Measure request latency HOT 2
- dns round-robin interceptor + cache HOT 3
- async dispatch handler helper
- Cannot convert argument to a ByteString because the character at index 46 has a value of 65286 which is greater than 255 HOT 2
- Undici.Request and AbortController doesn't work well HOT 17
- The RetryHandler receives a duplicate body when the server does not support Range requests.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from undici.