You are not logged in.
I'm a software developer so I'm working in a Next.js API route
I'm trying to open PDF files in Firefox (just pictures of different product labels), and when I click on the link I get a new tab showing error on the page saying "res.buffer() is not a function". This also happens in Chrome, and yes my packages are up to date. Me and my coworker couldn't figure out why this was happening so I decided to boot into windows, re-clone the repository, and run the app. To my surprise it started working for every product label.
I can open other PDFs in the browser on arch just fine so I'm not sure why this is happening. Am I missing a node package that would fix this?
I'm just really confused why the browsers in Arch wont load these pdfs, but running the same code on windows it works no problem.
Any ideas of whats going on here?
Offline
Well, you do know that Chrome for linux is something and Chrome for windows is a completely different thing right? Have you tried using other browsers like Opera?
Offline
Still getting a {"error":"res.buffer is not a function"} in the opera browser.
Offline
That's not the browser or the OS but whatever version of goddamnfuckingnodejsshit you're using.
Use arrayBuffer, https://github.com/perry-mitchell/webda … -368195381 or https://stackoverflow.com/a/66183520
Offline
I'm running node version 18.3.0 on arch.
I also tried the arrayBuffer() method but that didn't work either. I'm going to try downgrading node to see if that helps.
Offline
I also tried the arrayBuffer() method but that didn't work either.
Exactly how did you try it (where's the code)? And how did it not work (what error did it produce)?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Downgraded to node 16.15.1, problem fixed itself without having to change any code.
Offline
Downgraded to node 16.15.1, problem fixed itself without having to change any code.
Don't forget about that problem, though. You'll have to address it in the next 2 years when node 16 support ends and you have to move to node 18 or 20.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Noted
Offline