bug: Super expression must either be null or a function error
Describe the bug
Getting "TypeError: Super expression must either be null or a function" after upgrading to version 7.0.0 To Reproduce
Steps to reproduce the behavior:
- Upgrade stream-chat-react to version 7.0.0
Expected behavior
No error is displayed
Screenshots

If applicable, add screenshots to help explain your problem.
Package version
- stream-chat-react: 7.0.0
- stream-chat-js: 6.7.2
Desktop (please complete the following information):
- OS: [MacOS]
- Browser [chrome]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [chrome]
- Version [103.0.5060.53 (Official Build) (x86_64)]
Additional context
issue also occurred with version 9.1.4 , issue only occurs in production mode
Hi @gimurpe ,
this is not a known issue. we will need additional information to reproduce the problem since it is likely related to additional customizations on your side. Can you replicate the problem by modifying this sandbox? You can also contact us at [email protected] if the reproduction is specific to your account or data.
@petyosi I figured this is related to react-image-gallery introduced in version 7.0.0 : https://github.com/xiaolin/react-image-gallery/issues/624 .
@petyosi We are having the exact same issue. The error does not show on a development build, but as soon as we build for production, react won't even load due to this error.
@superCoderDOM how can we reproduce the problem on our side? Is this related to the image gallery from above?
Can't reproduce, no reply from the issue author, closing for now.
same issue @arnautov-anton

"react": "^16.9.0", "typescript": "^4.8.4", "@craco/craco": "^5.6.4",
im looking int this...
@gimurpe fixed:
problem was:
after webpack minification package of stream-chat-react -> react-image-gallery was broken.
solution:
disable optimization minimizer for react-image-gallery
craco.config.js or webpack.config:
const applySplitChunks = (webpackConfig) => {
webpackConfig.optimization.splitChunks = {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
// https://stackoverflow.com/a/52961891
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/](react-image-gallery)[\\/]/,
name(module) {
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
return `npm.${packageName.replace('@', '')}`;
},
},
},
}
}
const applyOptimizationFilter = (webpackConfig) => {
const skipMinimizationForChunk = [
'npm.react-image-gallery'
]
const terser = webpackConfig.optimization.minimizer.find(item => item.options.terserOptions);
terser.options.chunkFilter = (chunk) => {
return !skipMinimizationForChunk.includes(chunk.name);
}
}
module.exports = {
webpack: {
configure(webpackConfig) {
...
applySplitChunks(webpackConfig)
applyOptimizationFilter(webpackConfig)
return webpackConfig;
}

craco build
serve -s build
I'm getting this error when using React Native with Expo (latest SDK - 49) as well. 😢 Is there any way to fix it or workaround?
Hey, @gabrielfurini - would you be able to share with us some sort of a repository with reproduction steps? Expo is no longer officially supported with this package (for that we have this stream-chat-expo package) but we could try and take a look if you can provide said repository.
@arnautov-anton My mistake. The error was related to the stream-video-js package. The error message is the same, by the way. There is already a issue opened there: https://github.com/GetStream/stream-video-js/issues/1231