Git Product home page Git Product logo

Comments (16)

nishantmc avatar nishantmc commented on May 29, 2024

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.

ryankall avatar ryankall commented on May 29, 2024

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:
image

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.

Here is my ngModule:
image

Note** Without MatFileUploadModule in my project all my commands work for all builds.

from angular-material-fileupload.

nishantmc avatar nishantmc commented on May 29, 2024

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.

ryankall avatar ryankall commented on May 29, 2024

I updated all the package in my package.json, resulting a different error.

image

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.

jmsunseri avatar jmsunseri commented on May 29, 2024

I am getting this exact same error:

Unexpected value 'MatFileUploadModule' imported by the module 'AppModule'. Please add a @NgModule annotation

from angular-material-fileupload.

nishantmc avatar nishantmc commented on May 29, 2024

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.

jmsunseri avatar jmsunseri commented on May 29, 2024

from angular-material-fileupload.

nishantmc avatar nishantmc commented on May 29, 2024

Can you try angular 5.1.2?

from angular-material-fileupload.

jmsunseri avatar jmsunseri commented on May 29, 2024

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.

ryankall avatar ryankall commented on May 29, 2024

@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.

ryankall avatar ryankall commented on May 29, 2024

@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.

nishantmc avatar nishantmc commented on May 29, 2024

Hi Ryan,
The steps i followed to test the app are

  1. Clone example project
  2. git apply patch.txt
  3. npm install
  4. 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.

nishantmc avatar nishantmc commented on May 29, 2024

Also i pushed the patch to example repo so you can just pull the latest and try it.

from angular-material-fileupload.

ryankall avatar ryankall commented on May 29, 2024

@nishantmc This seems to be an angular universal error. we can close this issue. Thank you.

from angular-material-fileupload.

jmsunseri avatar jmsunseri commented on May 29, 2024

Have either of you identified a work around?

from angular-material-fileupload.

nishantmc avatar nishantmc commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.