Trying to use the lib.
import React, {Component} from 'react'
import classnames from 'classnames'
import {bindActionCreators} from 'redux'
import {connect} from 'react-redux'
import Autosuggest from 'react-autosuggest';
import {mouseTrap} from 'react-mousetrap';
import BZModal from 'BZModal';
import _ from 'underscore';
import {
Configure,
InstantSearch,
Index,
Highlight,
SearchBox
} from 'react-instantsearch/dom';
import {
connectHits,
connectAutoComplete
} from 'react-instantsearch/connectors';
import PubSub from '../PubSub';

But getting this error on the client.
Happens on Chrome.
We are using webpack 1.15.0
Npm 5.0.2
React 15.6.1
Node 6.9.2


Hi @danielbentov, could you give us a small repo reproducing the issue you're facing as it would be easier for us to understand.
Thanks in advance!
Hi @mthuret,
I can not create a repo that will mimic our product (we have 5 years of code there).
I can tell you that it seems that working with node 6.11.0 and Webpack caused the issue.
You are using util.inherits in your code.
https://github.com/webpack/webpack/issues/1019
https://github.com/defunctzombie/node-util/issues/17
Until then we can't use your lib in our product.
I didn't succeed reproducing the issue based on webpack 2 and node 6.11.0. I'm also confused because you indicate that you're using webpack 1.15.0 and node 6.9.2?
@bobylito, as it seems to be related to helper, did you already encounter this issue?
Also @danielbentov, can you indicate which version of react instantsearch you are using. And if you're not using 4.1.0-beta.2, can you try with it?
Still happening with 4.1.0-beta.2

@mthuret I fixed it with the following code:
node-libs-browser is using inherits 2.0.1.
It's a Webpack bug.
npm i [email protected] --save
Adding to webpack
resolve: {
alias: {
util$: path.resolve(__dirname, 'node_modules/util')
}
}
@danielbentov awesome! I'm closing this, then.
Don't hesitate to reach to us again for any questions about the lib :)
I still get the same error, it didn't help.
@VapiSoft please make a new issue with reproduction
module.exports = {
resolve: {
mainFields: ['browser', 'module', 'main']
}
};
Adding this to the webpack config solved it for me.
We haven't been using util for a while now, which version of React InstantSearch did you have this issue with @markpradhan ?
Ah my bad, i found this thread looking for an answer, thought it would help if people still had this issue as it looks very similar to whatever i was experiencing (issue in react-pdf). I am not using instant search at all. Sorry for pinging you guys! @Haroenv
Most helpful comment
@mthuret I fixed it with the following code:
node-libs-browser is using inherits 2.0.1.
It's a Webpack bug.
npm i [email protected] --saveAdding to webpack
resolve: { alias: { util$: path.resolve(__dirname, 'node_modules/util') } }