softsimon / ngx-bootstrap-multiselect

Angular 9+ Dropdown Multiselect Bootstrap
332 stars 198 forks source link

Build issue #66

Closed edcolyer closed 7 years ago

edcolyer commented 7 years ago

Getting the following error when I attempt to run my app with MultiselectDropdownModule imported as outlined in the README.md:

Error: (SystemJS) Unexpected token <
    SyntaxError: Unexpected token <
        at eval (<anonymous>)
        at Object.eval (http://localhost:3000/app/app.module.js:16:33)
        at eval (http://localhost:3000/app/app.module.js:50:4)
        at eval (http://localhost:3000/app/app.module.js:51:3)
        at eval (<anonymous>)
    Evaluating http://localhost:3000/angular-2-dropdown-multiselect/src/multiselect-dropdown.js
    Evaluating http://localhost:3000/app/app.module.js
    Evaluating http://localhost:3000/app/main.js
    Error loading http://localhost:3000/app/main.js
        at eval (<anonymous>)
        at Object.eval (http://localhost:3000/app/app.module.js:16:33)
        at eval (http://localhost:3000/app/app.module.js:50:4)
        at eval (http://localhost:3000/app/app.module.js:51:3)
        at eval (<anonymous>)
    Evaluating http://localhost:3000/angular-2-dropdown-multiselect/src/multiselect-dropdown.js
    Evaluating http://localhost:3000/app/app.module.js
    Evaluating http://localhost:3000/app/main.js
    Error loading http://localhost:3000/app/main.js
(anonymous) @ localhost/:20
ZoneDelegate.invoke @ zone.js:242
Zone.run @ zone.js:113
(anonymous) @ zone.js:520
ZoneDelegate.invokeTask @ zone.js:275
Zone.runTask @ zone.js:151
drainMicroTaskQueue @ zone.js:418
ZoneTask.invoke @ zone.js:349
bautistaaa commented 7 years ago

can you share your package.json

edcolyer commented 7 years ago
{
  "name": "clipboard",
  "version": "1.0.0",
  "description": "Clipboard roster and timesheet management app",
  "scripts": {
    "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
    "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first",
    "lint": "tslint ./app/**/*.ts -t verbose",
    "lite": "lite-server",
    "pree2e": "webdriver-manager update",
    "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
    "test-once": "tsc && karma start karma.conf.js --single-run",
    "tsc": "tsc",
    "tsc:w": "tsc -w"
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@angular/common": "~2.4.0",
    "@angular/compiler": "~2.4.0",
    "@angular/core": "~2.4.0",
    "@angular/forms": "~2.4.0",
    "@angular/http": "~2.4.0",
    "@angular/platform-browser": "~2.4.0",
    "@angular/platform-browser-dynamic": "~2.4.0",
    "@angular/router": "~3.4.0",
    "angular-2-dropdown-multiselect": "^0.4.0",
    "angular-in-memory-web-api": "~0.2.4",
    "core-js": "^2.4.1",
    "rxjs": "5.0.1",
    "systemjs": "0.19.40",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "@types/jasmine": "^2.5.36",
    "@types/node": "^6.0.46",
    "angular-2-dropdown-multiselect": "^0.4.0",
    "canonical-path": "0.0.2",
    "concurrently": "^3.1.0",
    "http-server": "^0.9.0",
    "jasmine-core": "~2.4.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "lite-server": "^2.2.2",
    "lodash": "^4.16.4",
    "protractor": "~4.0.14",
    "rimraf": "^2.5.4",
    "tslint": "^3.15.1",
    "typescript": "~2.0.10"
  },
  "repository": {}
}
edcolyer commented 7 years ago

Yeah, I just can't get this to work! If I just copy the .html and .ts file, and place them somewhere in my /app directory, then import them within my AppModule, I get this error:

Unhandled Promise rejection: Template parse errors:
'cb-app' is not a known element:
1. If 'cb-app' is an Angular component, then verify that it is part of this module.
2. If 'cb-app' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("

  <body>
    [ERROR ->]<cb-app>Loading AppComponent content here ...</cb-app>
  </body>
</html>
"): MultiselectDropdown@24:4 ; Zone: <root> ; Task: Promise.then ; Value: SyntaxError {_nativeError: Error: Template parse errors:
'cb-app' is not a known element:
1. If 'cb-app' is an Angular componen…} Error: Template parse errors:
'cb-app' is not a known element:
1. If 'cb-app' is an Angular component, then verify that it is part of this module.
2. If 'cb-app' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("

  <body>
    [ERROR ->]<cb-app>Loading AppComponent content here ...</cb-app>
  </body>
</html>
"): MultiselectDropdown@24:4
    at SyntaxError.BaseError [as constructor] (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1595:29) [<root>]
    at new SyntaxError (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1793:18) [<root>]
    at TemplateParser.parse (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:11210:21) [<root>]
    at JitCompiler._compileTemplate (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27480:70) [<root>]
    at eval (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27363:64) [<root>]
    at Set.forEach (native) [<root>]
    at JitCompiler._compileComponents (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27363:21) [<root>]
    at createResult (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27246:21) [<root>]
    at Zone.run (http://localhost:3000/node_modules/zone.js/dist/zone.js:113:43) [<root> => <root>]
    at http://localhost:3000/node_modules/zone.js/dist/zone.js:520:57 [<root>]
    at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:151:47) [<root> => <root>]
    at drainMicroTaskQueue (http://localhost:3000/node_modules/zone.js/dist/zone.js:418:35) [<root>]
    at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:349:25) [<root>]

I think it is something to do with the MultiselectDropdown component?

edcolyer commented 7 years ago

By the way, cb-app is my root AppModule component.