Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

ng2-file-upload: false positive #284

Closed
earshinov opened this issue Aug 25, 2019 · 12 comments
Closed

ng2-file-upload: false positive #284

earshinov opened this issue Aug 25, 2019 · 12 comments
Labels

Comments

@earshinov
Copy link
Contributor

I have just discovered this project.

Do I understand correctly that its aim is to illustrate which packages are compatible with Ivy and which are not?

If so, where can I see a list of compatible and incompatible projects?

Initially I assumed that I can just look inside the projects folder. But ng2-file-upload is there although its last release (1.3.0) is incompatible with Ivy. Here is an error message from our project:

ERROR in ../node_modules/ng2-file-upload/file-upload/file-upload.module.d.ts:1:22 - error TS-996002: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class

1 export declare class FileUploadModule {
                       ~~~~~~~~~~~~~~~~

In ng2-file-upload-ngcc, FileUploadModule is not even imported into AppModule. Perhaps that's why you did not discover this problem.

@earshinov
Copy link
Contributor Author

valor-software/ng2-file-upload#1092 - the issue regarding compatibility with Angular 8 and Ivy

@mgechev
Copy link
Member

mgechev commented Aug 25, 2019

@earshinov the ultimate goal of the project is to verify compatibility with Ivy. Currently, we verify partially only build-time compatibility.

Would you open a PR, importing the FileUploadModule in AppModule so we can get the build-time failure?

@earshinov
Copy link
Contributor Author

@mgechev , Yes, I can do it tomorrow.

@mgechev
Copy link
Member

mgechev commented Aug 25, 2019

Thanks!

@earshinov
Copy link
Contributor Author

There you go: https://github.com/mgechev/ngcc-validation/pull/289

ERROR in ../../node_modules/ng2-file-upload/file-upload/file-upload.module.d.ts:1:22 - error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

@mgechev mgechev added the ngcc label Oct 11, 2019
@mgechev
Copy link
Member

mgechev commented Oct 11, 2019

@earshinov is this issue still relevant? Can you reproduce it with the latest release?

@earshinov
Copy link
Contributor Author

@earshinov is this issue still relevant? Can you reproduce it with the latest release?

Yes, the issue is still there.

$ ng build ng2-file-upload-ngcc
0% compiling
Compiling @angular/core : module as esm5

Compiling @angular/common : module as esm5

Compiling @angular/platform-browser : module as esm5

Compiling @angular/platform-browser-dynamic : module as esm5

Compiling ng2-file-upload : module as esm5

chunk {main} main.js, main.js.map (main) 654 bytes [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 709 bytes [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 450 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 10.1 kB [initial] [rendered]
Date: 2019-10-12T14:47:54.550Z - Hash: f05777a33fd1635da221 - Time: 27451ms

ERROR in ../../node_modules/ng2-file-upload/file-upload/file-upload.module.d.ts:1:22 - error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

1 export declare class FileUploadModule {
                       ~~~~~~~~~~~~~~~~

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

ngcc-validation already uses the latest version of ng2-file-upload npm package, 1.3.0.

They are now looking for a maintainer, so I don't think we will have Ivy compatibility soon.

My PR into ng2-file-upload adding support for Ivy is still open.

@gkalpak gkalpak mentioned this issue Oct 17, 2019
45 tasks
@gkalpak
Copy link
Member

gkalpak commented Oct 23, 2019

This seems to have been fixed in the latest 1.4.0 release (thx @earshinov).
You can see it passing here, which is a build for PR #451.

@daniellnog
Copy link

Not working for latest version (1.4.0) with Angular 9.

@Khaldor48
Copy link

Hello same with Angular 9.1

Appears in the NgModule.exports of CoreModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class.
    
    This likely means that the library (ng2-file-upload) which declares FileUploadModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and upd
ate if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

@gkalpak
Copy link
Member

gkalpak commented Apr 30, 2020

I am going to close this issue, because the tests in this repo are passing with ng2-file-upload (see #284 (comment)). If it is failing for you, it is likely something related to your specific setup, but there is not much we can do without a reproduction of the issue (e.g. a repo we can checkout or exact commands to run to reproduce the error).

If it still failing for you (which based on your comments it is 😁), please open a new issue on angular/angular (where the ngcc code lives) with all the necessary info (including some form of (minimal 🙏) reproduction). Thank you!

@gkalpak gkalpak closed this as completed Apr 30, 2020
@aneova
Copy link

aneova commented May 5, 2020

Angular 9.1 I stack with this error:
ERROR in node_modules/ngx-uploader/lib/ngx-uploader.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (ngx-uploader) which declares NgxUploaderModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

1 export declare class NgxUploaderModule {
                       ~~~~~~~~~~~~~~~~~

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

No branches or pull requests

6 participants