-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parseWebStream
not exported in Node.js entry point
#2143
Comments
@pcbowers The ReadableStream must be indeed be a byte stream. Why fetch does not provide you one, I do not know. To see a working Web stream in action, try: https://audio-tag-analyzer.netlify.app/ |
Hmm, don't we still need to export https://github.com/Borewit/music-metadata/blob/v9.0.0/lib/index.ts#L11 |
parseWebStream
not exported in Node.js entry point
I would say it would, good catch! |
I see const response = await fetch('https://webrtc.github.io/samples/src/video/chrome.mp4')
const metadata = await parseWebStream(
response.body,
response.headers.get('content-type')
) ERROR The argument 'stream' must be a byte stream. Received ReadableStream { locked: false, state: 'readable', supportsBYOB: false } 1:35:35 PM
at new NodeError (node:internal/errors:405:5)
at setupReadableStreamBYOBReader (node:internal/webstreams/readablestream:2146:11)
at new ReadableStreamBYOBReader (node:internal/webstreams/readablestream:918:5)
at ReadableStream.getReader (node:internal/webstreams/readablestream:355:12)
at new WebStreamReader (node_modules/.pnpm/[email protected]/node_modules/peek-readable/lib/WebStreamReader.js:11:30)
at fromWebStream (node_modules/.pnpm/[email protected]/node_modules/strtok3/lib/core.js:24:36)
at parseWebStream (node_modules/.pnpm/[email protected]/node_modules/music-metadata/lib/core.js:32:23)
at Object.run (src/commands/video.ts:46:68)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:307:11)
at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:307:11)
at async runMain (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:445:7)
BYOB - Bring Your Own Buffer |
Furthermore, on use of this code:
I get this error:
I wish I knew more about it or else I would have debugged further! Leaving this here instead of on a new issue since I think fixing this would solve "avoid parsing entire file"
Originally posted by @pcbowers in #2135 (comment)
The text was updated successfully, but these errors were encountered: