resolve: resolve 1.7.0 fails to find bootstrap's package.json

We’re using bootstrap-loader (pinned at version 2.0.0-beta.22) in our webpack configuration to load bootstrap (pinned at version 4.0.0-alpha.6). bootstrap-loader depends on resolve. We were not pinning resolve’s version. Our build worked with resolve 1.6.0 but fails with 1.7.0 with this curious error message:

ERROR in ./~/bootstrap-loader/lib/bootstrap.loader.js!./~/bootstrap-loader/no-op.js
Module build failed: Error: Cannot find module '/builds/.../node_modules/bootstrap/package.json/package.json'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at exports.default (/builds/.../node_modules/bootstrap-loader/lib/utils/checkBootstrapVersion.js:8:20)
    at Object.module.exports.pitch (/builds/.../node_modules/bootstrap-loader/lib/bootstrap.loader.js:159:65)
 @ ./~/bootstrap-loader/loader.js 2:17-61
 @ multi ./app/App.jsx bootstrap-loader

Note that it’s looking for node_modules/bootstrap/package.json/package.json instead of node_modules/bootstrap/package.json, which is an existing file.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 30 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you very much! 1.7.1 works great!

I know this can be difficult, but that change really should have warranted a major version bump.

v1.7.1 has been released with this fix. 70850d2b5b710136a51a903cbcf63a73f22295f9 restores the “breaking” change and also makes packageFilter take three arguments, so that it’s easier to migrate the code that needs “dir” (and will be released in v2).

For what it’s worth though, I think you’re correct that this is a double edged sword: Both a bug fix and a breaking change.

I might have time for this tonight.