akserg / ng2-dnd

Angular 2 Drag-and-Drop without dependencies
MIT License
838 stars 251 forks source link

Error when importing to project #107

Open norenma opened 7 years ago

norenma commented 7 years ago

When I include DndModule.forRoot() in my module it fails, when I comment it out it runs.

The module to run when DndModule.forRoot() is imported.

Error message in Chrome:

reflection_capabilities.js:58Uncaught TypeError: ctorParameters.map is not a function at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:45562:45) at Reflector.parameters (http://localhost:4200/main.bundle.js:45696:44) at CompileMetadataResolver.getDependenciesMetadata (http://localhost:4200/main.bundle.js:26089:54) at CompileMetadataResolver.getTypeMetadata (http://localhost:4200/main.bundle.js:26054:26) at CompileMetadataResolver.getDirectiveMetadata (http://localhost:4200/main.bundle.js:25829:28) at http://localhost:4200/main.bundle.js:25898:49 at Array.forEach (native) at CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/main.bundle.js:25891:44) at http://localhost:4200/main.bundle.js:25879:50 at Array.forEach (native) ReflectionCapabilities.parameters @ reflection_capabilities.js:58 Reflector.parameters @ reflector.js:27 CompileMetadataResolver.getDependenciesMetadata @ metadata_resolver.js:435 CompileMetadataResolver.getTypeMetadata @ metadata_resolver.js:400 CompileMetadataResolver.getDirectiveMetadata @ metadata_resolver.js:175 (anonymous) @ metadata_resolver.js:244 CompileMetadataResolver.getNgModuleMetadata @ metadata_resolver.js:237 (anonymous) @ metadata_resolver.js:225 CompileMetadataResolver.getNgModuleMetadata @ metadata_resolver.js:212 RuntimeCompiler._compileComponents @ runtime_compiler.js:133 RuntimeCompiler._compileModuleAndComponents @ runtime_compiler.js:71 RuntimeCompiler.compileModuleAsync @ runtimecompiler.js:62 PlatformRef._bootstrapModuleWithZone @ applicationref.js:302 PlatformRef.bootstrapModule @ application_ref.js:284 (anonymous) @ main.ts:12 webpack_require @ bootstrap c4aed47…:52 (anonymous) @ .*$:7 webpack_require @ bootstrap c4aed47…:52 webpackJsonpCallback @ bootstrap c4aed47…:23 (anonymous) @ main.bundle.js:1

phixMe commented 7 years ago

I am running into this exact same issue, does anybody have a resolution for this?

norenma commented 7 years ago

I solved it by updating to angular 2.4. Not sure if there is another way..

NicoDino commented 7 years ago

Just came across the same issue while running an angular 2.1 app.

Is there a way around this problem without updating?

Cheers

akserg commented 7 years ago

Hi all, You can find the answer to your question here. So, you have two options here: