bergben / ng2-file-input

Angular 2 component that implements a drag and drop or select file selection, including preview.
MIT License
25 stars 11 forks source link

Please add a @NgModule (following migration to angular 5) #15

Closed little-boy closed 6 years ago

little-boy commented 6 years ago

Hi,

I'm getting compiler.js:466 Uncaught Error: Unexpected value '[object Object]' imported by the module 'HubModule'. Please add a @NgModule annotation.

I migrated angular 4 to 5 today. By checking with console.logs / breakpoints, I was able to identify the fact that ng2FileInputModule was responsible for it. Could not understand why since you declare @NgModule properly in your file.

Trace : Uncaught Error: Unexpected value '[object Object]' imported by the module 'HubModule'. Please add a @NgModule annotation. at syntaxError (compiler.js:466) at compiler.js:15088 at Array.forEach (<anonymous>) at CompileMetadataResolver.webpackJsonp.../../../compiler/esm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:15071) at CompileMetadataResolver.webpackJsonp.../../../compiler/esm5/compiler.js.CompileMetadataResolver.getNgModuleSummary (compiler.js:14998) at compiler.js:15086 at Array.forEach (<anonymous>) at CompileMetadataResolver.webpackJsonp.../../../compiler/esm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:15071) at CompileMetadataResolver.webpackJsonp.../../../compiler/esm5/compiler.js.CompileMetadataResolver.getNgModuleSummary (compiler.js:14998) at compiler.js:15086

bergben commented 6 years ago

Hi guys, thanks for your patience. I just fixed this in 1.0.16. Turns out you have to set typescript to version 2.4.2 in package.json, as never versions of TS don't work with ngc yet.