1

I'm getting errors with npm start. I wouldn't mind, but it causes me to not be able to run the server and view my local website. It's just because I use bootstrap-multiselect plugin which has no d.ts (typing) file created for it so in my ts file it has an error where I call $("#category-select").multiselect({}) saying:

property 'multiselect' does not exist on type jquery.

So my terminal says this when I use npm start:

Multiselect.component.ts(16,31): error TS2339: Property 'multiselect' does not exist on type 'JQuery'.

And then it won't start the local server. It is a complete blocker to my work. The bootstrap-multiselect plugin is very good and I do need to have it.

How can I either get it to ignore this error and continue to start the local server, or stop the error from happening?

package.json:

{
  "name": "the-vegan-repository",
  "version": "1.0.0",
  "scripts": {
    "lite-server-test": "lite-server --config=liteserver-test-config.json",
    "test": "tsc && concurrently \"npm run tsc:w\" \"npm run lite-server-test\" ",
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" \"sass --watch app\" \"sass --watch index.scss\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.4",
    "@angular/compiler": "2.0.0-rc.4",
    "@angular/core": "2.0.0-rc.4",
    "@angular/forms": "0.2.0",
    "@angular/http": "2.0.0-rc.4",
    "@angular/platform-browser": "2.0.0-rc.4",
    "@angular/platform-browser-dynamic": "2.0.0-rc.4",
    "@angular/router": "3.0.0-beta.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.4",
    "angular2-in-memory-web-api": "0.0.14",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.0",
    "ng2-select": "^1.0.3",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.12",
    "jquery": "v3.1.0"
  },
  "devDependencies": {
    "codelyzer": "0.0.26",
    "concurrently": "^2.0.0",
    "jasmine-core": "2.4.1",
    "lite-server": "^2.2.0",
    "tslint": "^3.13.0",
    "typescript": "^1.8.10",
    "typings": "^1.0.4"
  }
}

1 Answer 1

0

I found this workaround

I just casted to any:

(<any>$("#category-select")).multiselect();

I will leave this question open for now as there may be more answers.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.