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

getting error NullInjectorError: No provider for MatFileUploadQueue! #47

Closed
dharam1986 opened this issue Apr 8, 2019 · 6 comments
Closed

Comments

@dharam1986
Copy link

Hi , Getting below error while upload the file.
StaticInjectorError(AppModule)[MatFileUpload -> MatFileUploadQueue]:
StaticInjectorError(Platform: core)[MatFileUpload -> MatFileUploadQueue]:
NullInjectorError: No provider for MatFileUploadQueue!

My package.json is:
{
"name": "ace",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.2.0",
"@angular/cdk": "~7.3.3",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/flex-layout": "^7.0.0-beta.23",
"@angular/forms": "~7.2.0",
"@angular/material": "^7.3.3",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"angular-material-fileupload": "^2.0.0",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"ngx-infinite-scroll": "^7.1.0",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.4.0",
"time-ago-pipe": "^1.3.2",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.12.0",
"@angular-devkit/build-ng-packagr": "~0.12.0",
"@angular/cli": "~7.2.3",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^4.2.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.34.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}

Can some one please suggest what I am missing here.

@nishantmc
Copy link
Owner

Please refer #35

@dharam1986
Copy link
Author

dharam1986 commented Apr 12, 2019

Yes, I read all comments from #35, But I am using a matched version of material and CDK with the Angular, Still getting same error.

Here is my latest package.json
{
"name": "ace",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.2.12",
"@angular/cdk": "~7.3.6",
"@angular/common": "~7.2.12",
"@angular/compiler": "~7.2.12",
"@angular/core": "~7.2.12",
"@angular/flex-layout": "^7.0.0-beta.23",
"@angular/forms": "~7.2.12",
"@angular/material": "^7.3.6",
"@angular/platform-browser": "~7.2.12",
"@angular/platform-browser-dynamic": "~7.2.12",
"@angular/router": "~7.2.12",
"angular-material-fileupload": "^2.0.0",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"ngx-infinite-scroll": "^7.1.0",
"rxjs": "~6.4.0",
"rxjs-compat": "^6.4.0",
"time-ago-pipe": "^1.3.2",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.8",
"@angular-devkit/build-ng-packagr": "~0.12.0",
"@angular/cli": "~7.2.3",
"@angular/compiler-cli": "~7.2.12",
"@angular/language-service": "~7.2.12",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^4.2.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.34.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}

Is anything else I am missing?

@nishantmc
Copy link
Owner

It's good to match angular and material versions, I could find that above deps has unmatched packages. Also are you getting this error only when you are clicking the upload button or uploading the file? Can you provide the full error? and also how you import the module.

@dharam1986
Copy link
Author

Which one is unmatched? Please let me know So will correct it.
I am getting error While click on upload button. I have added both MatFileUpload and MatFileUpload queue components in files. FileUploadInputFor and bytepipe directive also added into same and all of these declare and export into app.module.
Below is the error I am getting:
ERROR Error: StaticInjectorError(AppModule)[MatFileUpload -> MatFileUploadQueue]:
StaticInjectorError(Platform: core)[MatFileUpload -> MatFileUploadQueue]:
NullInjectorError: No provider for MatFileUploadQueue!

@nishantmc
Copy link
Owner

I meant angular and material versions.
"@angular/animations": "~7.2.12",
"@angular/cdk": "~7.3.6",
"@angular/common": "~7.2.12",
"@angular/compiler": "~7.2.12",
"@angular/core": "~7.2.12",
"@angular/flex-layout": "^7.0.0-beta.23",
"@angular/forms": "~7.2.12",
"@angular/material": "^7.3.6",
"@angular/platform-browser": "~7.2.12",
"@angular/platform-browser-dynamic": "~7.2.12",
"@angular/router": "~7.2.12",

Also can you post on how are you importing the module?

@dharam1986
Copy link
Author

Finally, I have fix it. I have import those components and directive into Matfileupload module and import this module in my main app modules.
I know its same as normal import process but it work for me.
Thanks for your assistance.

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

2 participants