webpackbootstrap-sass

deployment error looking for package json in a folder named package.json


I am getting following error on webpack build

ERROR in ./node_modules/bootstrap- 
loader/lib/bootstrap.loader.js!./node_modules/bootstrap-loader/no-op.js
  Module build failed: Error: Cannot find module 
  '/Users/prashantkumar/Desktop/other/webapp-react/node_modules/bootstrap-sass/package.json/package.json'
 at Function.Module._resolveFilename (module.js:547:15)
 at Function._module2.default._resolveFilename (/Users/prashantkumar/Desktop/other/webapp-react/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:442:34)
 at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
 at exports.default (/Users/prashantkumar/Desktop/other/webapp-react/node_modules/bootstrap-loader/lib/utils/checkBootstrapVersion.js:8:20)
 at Object.module.exports.pitch (/Users/prashantkumar/Desktop/other/webapp-react/node_modules/bootstrap-loader/lib/bootstrap.loader.js:159:65)
@ ./node_modules/bootstrap-loader/loader.js 2:17-61
@ multi bootstrap-loader ./src/client.js

For a reason, it is looking for package.json file in a folder of the same name, and I do not know why. I've tried installing those again locally and on the server, but the error continues.

What do I do?


Solution

  • Steps to fix:

    1. create a .bootstraprc in the project root (the same folder of package.json)
    2. Put this content in the file: bootstrapVersion: 3 bootstrapPath: ..path to project../node_modules/bootstrap-sass
    3. Replace the file /node_modules/bootstrap-loader/lib/bootstrap.loader.js with this https://pastebin.com/NQ9tALZq
      1. Replace the file /node_modules/bootstrap-loader/lib/bootstrap.config.js with this: https://pastebin.com/VNJkRiiu

    Important: This is only a workaround, for a fix, please follow this issue: https://github.com/shakacode/bootstrap-loader/issues/341