Skip to content
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

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

Open
Strooss opened this issue Jun 27, 2024 · 7 comments

Comments

@Strooss
Copy link

Strooss commented Jun 27, 2024

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 () => {

@Yusuf007R
Copy link

same problem here, did you find any solution?

@clementdemily
Copy link

clementdemily commented Jul 7, 2024

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"
      }
    },

@Yusuf007R
Copy link

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

@clementdemily
Copy link

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.

@Yusuf007R
Copy link

@clementdemily quick question are you using discord.js?

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

@clementdemily
Copy link

@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

@Yusuf007R
Copy link

yep discordjs/discord.js#10358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants