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

[Bug] ffmpeg plugin giving error when including it in module's provider #4778

Closed
2 tasks
shyamal890 opened this issue May 17, 2024 · 3 comments
Closed
2 tasks

Comments

@shyamal890
Copy link

shyamal890 commented May 17, 2024

I'm submitting a ... (check one with "x")

Current behavior:
Adding @awesome-cordova-plugins/ffmpeg 's FFMpeg to module providers gives following error:

Invalid provider for the NgModule 'AppModule' - only instances of Provider and Type are allowed, got: [?[object Object]?, ..., ..., ...]

Expected behavior:

Steps to reproduce:

  1. npm i cordova-plugin-ffmpeg @awesome-cordova-pugins/ffmpeg
  2. Added FFMpeg to AppModule (imported with import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx';)
  3. Utilize FFMpeg in a service (This can be anything)

Related code:

insert any relevant code here

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic:

   Ionic CLI                     : 7.2.0 (C:\Users\Shyamal\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 8.1.1
   @angular-devkit/build-angular : 17.3.7
   @angular-devkit/schematics    : 17.3.7
   @angular/cli                  : 17.3.7
   @ionic/angular-toolkit        : 11.0.1

Capacitor:

   Capacitor CLI      : 6.0.0
   @capacitor/android : 6.0.0
   @capacitor/core    : 6.0.0
   @capacitor/ios     : 6.0.0

Utility:

   cordova-res (update available: 0.15.4) : 0.15.2
   native-run                             : 2.0.1

System:

   NodeJS : v20.10.0 (C:\Program Files\nodejs\node.exe)
   npm    : 10.2.4
   OS     : Windows 10
@MaximBelov
Copy link
Contributor

Hard to say

try not to use it as a provider

import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg';

@shyamal890
Copy link
Author

If I remove FFMpeg from module provider array then I get the following error when I try to utilize it in the service constructor:

taskModal.ts:165 ERROR NullInjectorError: R3InjectorError[AudioService -> AudioService -> AudioService -> [object Object] -> [object Object]]:
NullInjectorError: No provider for [object Object]!

import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx';

@Injectable({
    providedIn: 'root'
})
export class AudioService {

    constructor(
        private ffMpeg: FFMpeg
    ) {

    }

Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants