Comments (16)
Hi Ryan, Thanks for taking a look at the package. Fixed the package and pushed to npm. Can you try the latest version (0.0.6)? Please let me know. once it compiles fine, be sure to link the google material icons in the index.html (check src/index.html) and import the material theme (check src/vendor.ts)
from angular-material-fileupload.
The package now includes the the two component, however, I am getting different error which are puzzling.
When I run ng sever
, the webpack complies. Then I tried using the component by uploading a file -> select a .png file -> then error appears in web console:
The second thing is that my app is using angular cli. When I try to do a prod build which the command is: ng build --prod && ng build --prod --app 1 --output-hashing=false
. I get this error during build.
ERROR in Error: Unexpected value 'MatFileUploadModule in C:/Users/RyanKall/WebstormProjects/project/node_modules/angular-material-fileupload/index.d.ts' imported by the module 'AppModule in
C:/Users/RyanKall/WebstormProjects/project/src/app/app.module.ts'. Please add a @NgModule annotation.
Note** Without MatFileUploadModule in my project all my commands work for all builds.
from angular-material-fileupload.
Ryan, on first issue, after publishing in npm i tested this package with the https://github.com/nishantmc/angular-webpack-starter (a basic starter app), couldn't see any issues. The FileUploadInputFor directive depends on dom native element https://nishantmc.github.io/angular-material-fileupload.github.io/directives/FileUploadInputFor.html#source. Can you check the dependencies in your package.json?
from angular-material-fileupload.
I updated all the package in my package.json, resulting a different error.
I create an example for you to see the error. I not sure what I am doing wrong at this point.
https://github.com/ryankall/example
For the Full build the error remain the same:
ERROR in Error: Unexpected value 'MatFileUploadModule in C:/Users/RyanKall/WebstormProjects/project/node_modules/angular-material-fileupload/index.d.ts' imported by the module 'AppModule in
C:/Users/RyanKall/WebstormProjects/project/src/app/app.module.ts'. Please add a @NgModule annotation.
from angular-material-fileupload.
I am getting this exact same error:
Unexpected value 'MatFileUploadModule' imported by the module 'AppModule'. Please add a @NgModule annotation
from angular-material-fileupload.
patch.txt
Ryan, i pushed version 0.0.8 (fix for dependency issue). I Was trying the example repo that you gave. I was able to make it work by changing the packages a bit. Please try to apply the patch.txt. Please let me know.
Justin, Can you try the latest version 0.0.8? also please check the package.json for the dependencies.
from angular-material-fileupload.
from angular-material-fileupload.
Can you try angular 5.1.2?
from angular-material-fileupload.
Sorry it took me so long to get back to this but I have updated to 5.2.2 and now I'm getting the same error as @ryankall
ERROR Error: StaticInjectorError(AppModule)[FileUploadInputFor -> ElementRef]: StaticInjectorError(Platform: core)[FileUploadInputFor -> ElementRef]: NullInjectorError: No provider for ElementRef!
from angular-material-fileupload.
@jmsunseri Try it with 5.1.2 as he recommended and add apply the patch.txt . I will do it later today.
from angular-material-fileupload.
@nishantmc
I tried the patch but the problem still exist for me.
For the Full build the error remain the same ( npm run build:client-and-server-bundles):
ERROR in Error: Unexpected value 'MatFileUploadModule in C:/Users/RyanKall/WebstormProjects/project/node_modules/angular-material-fileupload/index.d.ts' imported by the module 'AppModule in
C:/Users/RyanKall/WebstormProjects/project/src/app/app.module.ts'. Please add a @NgModule annotation.
I added you to my project so if you like to send me any updated I can just pull and run it.
from angular-material-fileupload.
Hi Ryan,
The steps i followed to test the app are
- Clone example project
- git apply patch.txt
- npm install
- npm start
I had a backend app running to which is the upload api. I tried just now and it works fine.
I tried the cmd npm run build:client-and-server-bundles, but yes it fails with the same error. I haven't used angular cli so not very sure abt the issue. I always use webpack to build the projects.
from angular-material-fileupload.
Also i pushed the patch to example repo so you can just pull the latest and try it.
from angular-material-fileupload.
@nishantmc This seems to be an angular universal error. we can close this issue. Thank you.
from angular-material-fileupload.
Have either of you identified a work around?
from angular-material-fileupload.
Justin, i think this issue is due to version conflicts between angular packages. https://github.com/ryankall/example is a working version. can you compare the packages in that repo with yours? I will be revisiting the dependent packages for angular-material-fileupload in some time. Will update on this.
from angular-material-fileupload.
Related Issues (20)
- getting error NullInjectorError: No provider for MatFileUploadQueue! HOT 6
- ERROR in node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'. HOT 3
- No longer working with Angular 8 (DOCUMENT import from @angular/platform-browser)
- not working HOT 1
- NullInjectorError: No provider for ElementRef! -- Angular 8 HOT 7
- No Validation Support
- How to get the response from the server HOT 1
- NullInjectorError HOT 10
- Failed to find the exported name of node HOT 9
- Not working in Angular 10.1.4 HOT 6
- No File Type Restrictions
- can't compile angular-material-fileupload
- Not working with Angular 9.0.7 HOT 1
- Content Type is set to application/json HOT 1
- Not Working with New Angular Versions - Solution HOT 1
- Upload single file HOT 1
- Support Injecting custom MatFileUploadQueueService
- Can we upload file in chunks ?
- Is there support for using Firebase Auth to save to Firebase Storage - seems as though this does not work
- No support for Angular 9+
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-material-fileupload.