cybercomet / ngx-nestable

Angular nestable list. This is a rewrite of Jquery nestable library.
https://cybercomet.github.io/ngx-nestable/
23 stars 17 forks source link

@angular/core 5.2.11 Unexpected value 'NestableModule' imported by the module 'AppModule'. Please add a @NgModule annotation. #13

Open ghost opened 5 years ago

ghost commented 5 years ago

In a @angular/core 5.2.11 after declaration:

import { NestableModule } from 'ngx-nestable';

@NgModule({
  imports: [NestableModule],
})
export class AppModule {}

The browser log:

compiler.js:486 Uncaught Error: Unexpected value 'NestableModule' imported by the module 'AppModule'. Please add a @NgModule annotation.
    at syntaxError (compiler.js:486)
    at compiler.js:15240
    at Array.forEach (<anonymous>)
    at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15215)
    at JitCompiler._loadModules (compiler.js:34413)
    at JitCompiler._compileModuleAndComponents (compiler.js:34374)
    at JitCompiler.compileModuleAsync (compiler.js:34268)
    at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:239)
    at PlatformRef.bootstrapModule (core.js:5578)
    at Object.<anonymous> (app.module.ts:148)
syntaxError @ compiler.js:486
(anonymous) @ compiler.js:15240
CompileMetadataResolver.getNgModuleMetadata @ compiler.js:15215
JitCompiler._loadModules @ compiler.js:34413
JitCompiler._compileModuleAndComponents @ compiler.js:34374
JitCompiler.compileModuleAsync @ compiler.js:34268
CompilerImpl.compileModuleAsync @ platform-browser-dynamic.js:239
PlatformRef.bootstrapModule @ core.js:5578
(anonymous) @ app.module.ts:148
__webpack_require__ @ bootstrap cab16a5d8036aeef1968:54
(anonymous) @ app.coffee:484
__webpack_require__ @ bootstrap cab16a5d8036aeef1968:54
(anonymous) @ index.ts:3
__webpack_require__ @ bootstrap cab16a5d8036aeef1968:54
webpackJsonpCallback @ bootstrap cab16a5d8036aeef1968:25
(anonymous) @ app.chunk.js:1
client:147 [WDS] Warnings while compiling.
warnings @ client:147
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:887
SockJS._transportMessage @ sockjs.js:885
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2961
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/ngx-nestable/node_modules/@angular/core/@angular/core.es5.js
5659:15-36 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/ngx-nestable/node_modules/@angular/core/@angular/core.es5.js
 @ ./node_modules/ngx-nestable/ngx-nestable/lib.es5.js
 @ ./app/coffee/app.module.ts
 @ ./app/coffee/app.coffee
 @ multi (webpack)-dev-server/client?http://0.0.0.0:8082 ./app/coffee/app.coffee
speculees commented 5 years ago

can you please provide dependencies from your package.json? also, if you're using version 0.9.2 try 0.9.1 and report if problem persists

ghost commented 5 years ago
    "@angular/animations": "^5.2.9",
    "@angular/common": "^5.0.2",
    "@angular/compiler": "^5.0.2",
    "@angular/core": "^5.0.2",
    "@angular/forms": "^4.4.4",
    "@angular/http": "^5.0.2",
    "@angular/platform-browser": "^5.0.2",
    "@angular/platform-browser-dynamic": "^5.0.2",
    "@angular/upgrade": "^5.0.2",

Ok, it works with 0.9.1, issue now with 0.9.1 is angular material is not recognized:

 compiler.js:486 Uncaught Error: Template parse errors:
'mat-icon' is not a known element:
speculees commented 5 years ago

Are you using mat-icon component as described in the demo or readme page? If so, you'll need to install angular material package npm install --save @angular/material @angular/cdk @angular/animations

amanshakya017 commented 5 years ago

not working in case of mine

can you please provide dependencies from your package.json? also, if you're using version 0.9.2 try 0.9.1 and report if problem persists

not working in case of mine