Bootstrap: Cannot convert object to primitive value

Software

I'm getting an error on my Laravel + Bootstrap 4 project on my UI. It comes up if I try to hit the burger menu in my mobile view. 

Cannot convert object to primitive value

This is my package.json:

    "devDependencies": {
        "axios": "^0.19",
        "bootstrap": "^4.4.1",
        "cross-env": "^7.0",
        "jquery": "^3.5.0",
        "laravel-mix": "^5.0.1",
        "lodash": "^4.17.13",
        "popper.js": "^1.16.1",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.15.2",
        "sass-loader": "^8.0.0",
        "vue-template-compiler": "^2.6.11"
    }
Computer Question created: 2020-04-18 19:03 PeterNicks0n

2

This happends because Bootstrap 4.4.1 is not compatible with jquery 3.5.0. To solve this problem simply install jquery 3.4.1 and it will work: 

  • Delete your node_modules directory.
  • Put  jquery 3.4.1 into your package.json
  • Run npm install
  • Run npm run dev
  • Test the solution in your browser.
    "devDependencies": {
        "axios": "^0.19",
        "bootstrap": "^4.4.1",
        "cross-env": "^7.0",
        "jquery": "3.4.1",
        "laravel-mix": "^5.0.1",
        "lodash": "^4.17.13",
        "popper.js": "^1.16.1",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.15.2",
        "sass-loader": "^8.0.0",
        "vue-template-compiler": "^2.6.11"
    }
answered 2020-04-20 06:54 d3m