fluent-ffmpeg/node-fluent-ffmpeg

Property 'on' does not exist on type 'FfmpegCommand'. Did you mean to access the static member 'FfmpegCommand.on' instead?

Strooss opened this issue · 7 comments

Version information

  • fluent-ffmpeg version:2.1.2
  • ffmpeg version: 2023-07-16-git-c541ecf0dc-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  • OS: Windows 11

Code to reproduce

   ffmpeg()
        .input(`${dir}/${attachment.id}.gif`)
        .fromFormat("gif")
        .toFormat("mp4")
        .frames(240)
        .noAudio()
        .output(`${dir}/${attachment.id}.mp4`)
        .on("start", async () => {
          await interaction.editReply({
            content: "Started changing the file format..",
          });
        })

error TS2576: Property 'on' does not exist on type 'FfmpegCommand'. Did you mean to access the static member 'FfmpegCommand.on' instead?

87 .on("start", async () => {

same problem here, did you find any solution?

Same problem here :

    const promise = new Promise((resolve, reject) => {
      this.getFFmpegRenderer(audioFilesPath, audioFilePath)
        .on("end", (output: unknown) => {
          resolve(output);
        })
        .on("error", (err: unknown) => {
          console.error("[CreateAudio][concatAudio] Error", err);
          reject(err);
        });
    });
Property 'on' does not exist on type 'FfmpegCommand'. Did you mean to access the static member 'FfmpegCommand.on' instead?ts(2576)
    "node_modules/@types/fluent-ffmpeg": {
      "version": "2.1.24",
      "resolved": "https://registry.npmjs.org/@types/fluent-ffmpeg/-/fluent-ffmpeg-2.1.24.tgz",
      "integrity": "sha512-g5oQO8Jgi2kFS3tTub7wLvfLztr1s8tdXmRd8PiL/hLMLzTIAyMR2sANkTggM/rdEDAg3d63nYRRVepwBiCw5A==",
      "dev": true,
      "dependencies": {
        "@types/node": "*"
      }
    },
    "node_modules/fluent-ffmpeg": {
      "version": "2.1.3",
      "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz",
      "integrity": "sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==",
      "dependencies": {
        "async": "^0.2.9",
        "which": "^1.1.1"
      },
      "engines": {
        "node": ">=18"
      }
    },

downgrade to typescript 5.3.3 fixes the issue it seems the EventEmitter interface changed with typescript 5.5

downgrade to typescript 5.3.3 fixes the issue it seems the EventEmitter interface changed with typescript 5.5

Thanks for your reply !

Yes it seems that EventEmitter interface has changed its prototype, using the keyword static on on method.
Though, it's not really a fix, you can downgrade like as you suggested, or annotate with @ts-expect-error.

@clementdemily quick question are you using discord.js?

it seems like they are overriding the EventEmitter interface for some reason
image

@clementdemily quick question are you using discord.js?

it seems like they are overriding the EventEmitter interface for some reason image

Yes, indeed !

I've noticed that I got no error since a few version updates though