You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to use ytdl-core within a Server API Route Handler results in the validation export of ytdl-core to stop functioning, due to the fact TypeScript is most likely not understanding the string trim() method, looks like its also not inferring types from the JSDoc comments.
What is supposed to happen
Information including formats on the specified link should be returned.
Stack Trace
TypeError: Cannot read properties of undefined (reading 'trim')
at exports.validateID (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/ytdl-core/lib/url-utils.js:75:44)
at exports.getVideoID (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/ytdl-core/lib/url-utils.js:58:15)
at exports.<computed> [as getInfo] (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/ytdl-core/lib/info.js:484:29)
at POST (webpack-internal:///(rsc)/./src/app/api/fetchYouTubeAudio/route.ts:13:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:53446
at async e_.execute (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:44747)
at async e_.handle (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:54700)
at async doRender (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1377:42)
at async cacheEntry.responseCache.get.routeKind (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1599:28)
at async DevServer.renderToResponseWithComponentsImpl (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1507:28)
at async DevServer.renderPageComponent (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1924:24)
at async DevServer.renderToResponseImpl (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1962:32)
at async DevServer.pipeImpl (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:920:25)
at async NextNodeServer.handleCatchallRenderRequest (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js:272:17)
at async DevServer.handleRequestImpl (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:816:17)
at async /home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:339:20
at async Span.traceAsyncFn (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/trace/trace.js:154:20)
at async DevServer.handleRequest (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
at async invokeRender (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:174:21)
at async handleRequest (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:353:24)
at async requestHandlerImpl (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:377:13)
at async Server.requestListener (/home/hopper/Code Projects (Ongoing)/Reaction Audio Player/reaction-audio-player/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/lib/start-server.js:141:13)
Explanation
Attempting to use ytdl-core within a Server API Route Handler results in the validation export of ytdl-core to stop functioning, due to the fact TypeScript is most likely not understanding the string trim() method, looks like its also not inferring types from the JSDoc comments.
What is supposed to happen
Information including formats on the specified link should be returned.
Stack Trace
Code Snippet (Next.js App Directory, Route Handler)
Environment
The text was updated successfully, but these errors were encountered: