New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve "@socket.io/component-emitter" #1598
Comments
I am getting this error. Did anyone found any solution? |
This is weird. The Is it resolved in newer versions of React Native (0.73.4 currently)? Possibly related: facebook/react-native#29489 |
Source of the |
Did anyone found any solution? |
In order to remove the .mjs file, which causes some problems with React Native. Related: socketio/socket.io-client#1598
This should be fixed by socketio/emitter@ba6b56d, included in |
@darrachequesne Thanks for the udpate, yes this does fix the issue with the socket.io-client import for me. For clarity though it's worth noting that I was also getting similar import issues with other dependencies. With a little more digging the fix is documented in the metro bundler docs which is demonstrated in the following snippet: const { getDefaultConfig } = require('expo/metro-config');
const config = getDefaultConfig(__dirname, {
...
});
module.exports = (async () => {
// add support to resolve modules with .(c|m)js extensions
config.watcher.additionalExts = ['cjs', 'mjs']
return config;
})(); |
@jpgorman awesome, thanks for the update 👍 |
Describe the bug
Using socket.io-client in react native causes a build error
To Reproduce
Please fill the following code example:
Socket.io-client version:
^4.7.2
Client
Expected behavior
To resolve Socket.io-client library modules
Platform:
Additional context
I did find a work around via the metro bundler config using the following
The text was updated successfully, but these errors were encountered: