Closed hallister closed 9 years ago
Are you webpack-bundling your tests? You'd need to exclude that require to silence that warning
Yes I am and that didn't even occur to me. Thanks!
If it was node requiring it would have just blown up :)
Hey @hallister - I'm having a similar issue over at #15, and was wondering how you excluded that module? I am pretty new to testing with karma/webpack/react and my naive attempts have not been successful, and would be very grateful for some direction. Thanks!
As @glenjamin mentions in #15, using webpack's IgnorePlugin
worked for me!
Hello, I'm a Browserify user and I'm getting this error as well:
28 10 2015 16:37:21.079:ERROR [framework.browserify]: bundle error
28 10 2015 16:37:21.080:ERROR [framework.browserify]: Error: Cannot find module 'react/lib/ReactContext' from '/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/skin-deep'
Any ideas?
You'll need to add whatever the equivalent browserify config is to exclude that import.
Got it, thanks. For anyone curious, I had to add this to my karma config:
browserify: {
debug: true,
configure: function(bundle) {
bundle.exclude('react/lib/ReactContext');
}
}
What is the line for doing this w/ Webpack? I've tried it with
new webpack.IgnorePlugin('react/lib/ReactContext'),
in my webpack config, and it didn't work. Tried it without quotes, too. Thanks for any help.
@realisation the IgnorePlugin takes a regex as it's argument https://webpack.github.io/docs/list-of-plugins.html#ignoreplugin
I'm going to add examples into a new troubleshooting section in the readme
I'm getting this error running 0.14.0-rc1 which is particularly odd since the line its arguing is executing should never happen:
It has no impact on tests but I find it odd that a conditional require is executing when the condition is false.