- Are you on the latest version of ytdl-core?
- Search the list of issues for a possible duplicate.
- #1141 (closed for a few months now)
SyntaxError: Invalid regular expression: missing /
File "node:vm", line 100, col 7, in new Script
File "/app/node_modules/ytdl-core/lib/sig.js", line 116, col 51, in exports.decipherFormats
const nTransformScript = functions.length > 1 ? new vm.Script(functions[1]) : null;
File "node:internal/process/task_queues", line 95, col 5, in process.processTicksAndRejections
File "index 0", in Promise.all
File "/app/node_modules/ytdl-core/lib/info.js", line 401, col 17, in exports.getInfo
let results = await Promise.all(funcs);
Temporary fixed solution is downgrading ytdl-core version forked by @GreepTheSheep:
npm i ytdl-core@https://github.com/GreepTheSheep/node-ytdl-core
For mine, this fixed the "Invalid regular expression: missing / "
I recommend using @distubejs fork since it is active, has fast bug fixes, and has better performance with undici.
npm i @distube/ytdl-core
If you don’t want to change your package name, you can overwrite the original package with this command.
npm i ytdl-core@npm:@distube/ytdl-core
It should work better since #1217 patch is copied from this fork
For me the patch by @khlevon worked
"ytdl-core": "https://github.com:khlevon/node-ytdl-core.git#v4.11.4-patch.2"
Same This fix still works tho: https://github.com/fent/node-ytdl-core/issues/1110#issuecomment-1219856316
Fixed 😅🫡
@Mittelblut9 in your patch one important line is removed, here is a correct one https://gist.github.com/talyuk/6f197e6a58b7b8107a7c2d7f442b97ae
It works perfectly on localhost however I am not able to deploy to Firebase Functions after adding this to package.json. Any solution?
This worked for me: Using last ytdl version (same download speed)