facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.23k stars 626 forks source link

Metro bundler breaks socket.io (from 0.57.4 till 0.59rc) - unable to connect. #365

Open csotiriou opened 5 years ago

csotiriou commented 5 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Metro bundler seems to package latest versions of socket.io in such a way that it breaks completely. Even on a very simple application with a basic socket.io server enabled, the client will be unable to connect. This issue is present on both iOS and Android, all versions. It started since React Native 0.57.4. RN 0.57.3 worked fine.

Other issue: https://github.com/facebook/react-native/issues/22043

The reason I am suspecting the Metro bundler is at fault, is that I switched to Haul as my bundler (https://github.com/callstack/haul) and the problem disappeared completely from all versions I tried (version 0.57.x till 0.59.rc).

In the linked issue people say that switching to an older version of Socket.io seems to solve the issue. Haven't been able to reproduce this yet.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

Install latest version of React Native (0.59RC, 0.58, or 0.57.4 and later), install socket.io, configure it to connect to a socket.io server (any server) and run.

What is the expected behavior?

The socket.io would be able to connect to a socket.io enabled server.

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

peterchibunna commented 5 years ago

Any update on this?

basitsattar commented 5 years ago

Any update?

airiddha commented 5 years ago

any update?

anttirauh commented 5 years ago

Any update on this?

This issue is important to fix, because Google do not accept new Android releases without 64 bit support. 64 bit support comes with RN 0.59.

In August 2019, Play store will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions.

In practice: this issue currently prevents releasing/updating apps which use socket.io library!

EDIT: I am using RN 0.60.5. iOS works fine, but Android release build can not open socket connection to the server. Android debug build connects successfully.

EDIT2: downgrading to RN 0.59.10 solved my case.

0x1af2aec8f957 commented 2 months ago

Is there any latest progress on this issue?