Preact + @mui + @emotion - app crashes when open select #4456
-
Everithing works fine until open the Select component, but not all selects
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
This seems to come from
is it possible that the usage of hooks is so that the second argument is missing in their select? Changing that to
should prevent this crash |
Beta Was this translation helpful? Give feedback.
-
There was not problems with preact, only my mistake. I forgot to add preact to dependencies |
Beta Was this translation helpful? Give feedback.
-
Some news... new webpack.container.ModuleFederationPlugin({
name: 'shell',
filename: `shell.${version}.js`,
shared: {
preact: {
sharedKey: 'preact',
requiredVersion: ''10.22.1,
version: '10.22.1',
singleton: true
}
},
}), Thats because we share preact, but there are some nested modules in preact, like hooks ore compat. We can fix it by adding slash in after preact name: new webpack.container.ModuleFederationPlugin({
name: 'shell',
filename: `shell.${version}.js`,
shared: {
'preact/': {
sharedKey: 'preact',
requiredVersion: ''10.22.1,
version: '10.22.1',
singleton: true
}
},
}), In this case, both shell and remote applications import all things from preact shared from shell, but the remote app crashes with |
Beta Was this translation helpful? Give feedback.
This seems to come from
is it possible that the usage of hooks is so that the second argument is missing in their select?
Changing that to
should prevent this crash