Instantsearch.js: 1.11.9 breaks in Webpack

Created on 17 May 2017  路  6Comments  路  Source: algolia/instantsearch.js

We noticed our builds breaking this morning with the error

Module not found: Error: Cannot resolve module 'instantsearch.js'

Upon noticing there was a new release we found our package.json was set to install major releases and had installed 1.11.9.

Reverting to 1.8.13 fixed the error.

I'm somewhat a novice in Webpack so let me know if you need any other details.

Bug Needs Investigation Question

Most helpful comment

v1.11.10 is now available, with the correct files!

All 6 comments

Would be nice if you could get an as small as possible reproduction, or if that is really not possible your whole app. It kinda sounds like you forgot an npm install. The change from 1.8 to 1.11 should definitely not change anything regarding how the module is published though...

We're seeing the same issue. Using any project with a reliance on instantsearch.js, run

$ npm uninstall instantsearch.js
$ npm clear cache
$ npm install instantsearch.js

This will ensure 1.11.9 is installed. Running the server with this version installed reproduces the issue.

A temporary work around would be:

$ npm uninstall instantsearch.js
$ npm clear cache
$ npm install [email protected]

Could you share a reproducible example @jackellenberger , I have a guess what might be the cause, but I have a hard time reproducing it

Sure, here's a minimal example:

index.js

'use strict';

var algoliaSearch = require('instantsearch.js');
console.log(algoliaSearch !== undefined);

package.json:

{
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "instantsearch.js": "~1.11.4"
  }
}

To reproduce:

npm install
npm start

This yields the output

> @ start /home/pair/bt/instant
> node index.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'instantsearch.js'
    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 Object.<anonymous> (/home/pair/bt/instant/index.js:3:21)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)

To fix:

npm uninstall instantsearch.js
npm install [email protected]

Which yields

> [email protected] start /home/pair/bt/instant
> node index.js

Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
true

Thanks a lot, we happened to find the error and 1.11.10 will be deployed with the fix in a few minutes

cc @iam4x

v1.11.10 is now available, with the correct files!

Was this page helpful?
0 / 5 - 0 ratings