I’m encountering an issue when trying to fetch data from my Next.js app. The data I want to retrieve is located is my NAS Synology device. When I make the fetch request from the NextJS app on server side, I receive a “Connect Timeout Error,” while the same request works fine with a curl or in my browser.
Here’s the error message I’m getting:
⨯ unhandledRejection: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (node:internal/deps/undici/undici:8522:28)
at node:internal/deps/undici/undici:8480:50
at Immediate._onImmediate (node:internal/deps/undici/undici:8511:13)
at process.processImmediate (node:internal/timers:476:21)
at process.callbackTrampoline (node:internal/async_hooks:130:17) {
code: 'UND_ERR_CONNECT_TIMEOUT'
Could someone provide guidance on how to troubleshoot and resolve this issue? Any insights or suggestions would be greatly appreciated. Thank you!