[Error [TimeoutError]: The operation was aborted due to timeout]
Unanswered
Shayokh posted this in #help-forum
ShayokhOP
Hello. I have been trying to fetch an event image from the Sanity CMS cdn but getting this error -
Please note that the error showed up twice when I tried refreshing and the image finally loaded on the 3rd refresh. I am currently in local development stage and planing to host the project on MellowHost.
GET /events/tree-plantation-around-dhaka 200 in 2777ms
[Error [TimeoutError]: The operation was aborted due to timeout] {
code: 23,
INDEX_SIZE_ERR: 1,
DOMSTRING_SIZE_ERR: 2,
HIERARCHY_REQUEST_ERR: 3,
WRONG_DOCUMENT_ERR: 4,
INVALID_CHARACTER_ERR: 5,
NO_DATA_ALLOWED_ERR: 6,
NO_MODIFICATION_ALLOWED_ERR: 7,
NOT_FOUND_ERR: 8,
NOT_SUPPORTED_ERR: 9,
INUSE_ATTRIBUTE_ERR: 10,
INVALID_STATE_ERR: 11,
SYNTAX_ERR: 12,
INVALID_MODIFICATION_ERR: 13,
NAMESPACE_ERR: 14,
INVALID_ACCESS_ERR: 15,
VALIDATION_ERR: 16,
TYPE_MISMATCH_ERR: 17,
SECURITY_ERR: 18,
NETWORK_ERR: 19,
ABORT_ERR: 20,
URL_MISMATCH_ERR: 21,
QUOTA_EXCEEDED_ERR: 22,
TIMEOUT_ERR: 23,
INVALID_NODE_TYPE_ERR: 24,
DATA_CLONE_ERR: 25
}
○ Compiling /_error ...
✓ Compiled /_error in 844ms
GET /_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fq99ib49k%2Fproduction%2Fa5070be52ba27971ba1aa268edc9663d7f98a958-8192x4900.jpg&w=1920&q=75 500 in 7943ms
GET /_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fq99ib49k%2Fproduction%2Fa5070be52ba27971ba1aa268edc9663d7f98a958-8192x4900.jpg&w=1920&q=75 500 in 925msPlease note that the error showed up twice when I tried refreshing and the image finally loaded on the 3rd refresh. I am currently in local development stage and planing to host the project on MellowHost.
17 Replies
Can I increase the timeout somehow?
I'm looking if there is any option in next/image
Can you just try this? https://github.com/lorenzodejong/next-sanity-image
Because they've shown next/image as an example, so it might be handled correctly there
Because they've shown next/image as an example, so it might be handled correctly there
if you want a simple fix, it is to just add option
optimized or maybe in next/imagebut image optimization would then be disabled
ShayokhOP
I don't understand what's NextJs's issue with Images man. They go overkill on a simple element for no apparent reason.
@Shayokh I don't understand what's NextJs's issue with Images man. They go overkill on a simple element for no apparent reason.
if you don't want image optimisation, just add
unoptimized prop to next/imageit should fix it
@Anay-208 if you don't want image optimisation, just add `unoptimized` prop to next/image
ShayokhOP
Does that increase the timeout? I mean how exactly is it fixing the issue?
when you use next/image for rendering Images, it basically creates a proxy url in
/_next/image, and it'll optimize images, like serve correct size for each device, which also prevents layout shift and results in faster load speed.when you are adding
unoptimized, it disables those optimizations, hence fixing the issueShayokhOP
Hmm
you can use sanity image optimization if you like(after disabling next image optimization and use custom loader): https://www.sanity.io/docs/image-urls
which should work just fine
which should work just fine
you can use a custom loader for this
ShayokhOP
I will try and let you know