facebook / metro

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

Useless debugger, wrong source map, shifted breakpoints #1076

Open robozb opened 1 year ago

robozb commented 1 year ago

The debugger are useless on this way, the breakpoints is shifted:

https://github.com/facebook/metro/assets/8656998/8dea359d-2d94-4255-9116-b2f8d77de24d

...
  "dependencies": {
    "expo": "~49.0.8",
    "expo-status-bar": "~1.6.0",
    "react": "18.2.0",
    "react-native": "0.72.4"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
...
robozb commented 1 year ago

It seems the problem is related with expo sdk 49.

I tried all the things with Expo SDK 48, and the debugger works fine with proper breakpoints!

https://github.com/expo/expo/assets/8656998/65311af8-1e51-4911-b14e-386ea4703c7a

Both demo projects:

visto9259 commented 1 year ago

I have the same issue since I moved from Expo SDK47 (RN 0.70) to Expo SDK49 (RN 0.72). This is more likely a React Native issue than an Expo issue. I have not tried to debug on SDK48 (RN 0.71). If it works with 48, I may decide to downgrade to 48 until there is a fix for this.

visto9259 commented 1 year ago

@robozb Did you also log this issue in the React Native repo?

robozb commented 1 year ago

I don't remember, maybe yes

robozb commented 1 year ago

I have the same issue since I moved from Expo SDK47 (RN 0.70) to Expo SDK49 (RN 0.72). This is more likely a React Native issue than an Expo issue. I have not tried to debug on SDK48 (RN 0.71). If it works with 48, I may decide to downgrade to 48 until there is a fix for this.

It works in SDK 48, I have been using it for a long time

visto9259 commented 1 year ago

@robozb I am curious, when did you start using SDK49 and noticed the issue. I upgraded from SDK47 to SDK48 a couple of weeks ago but SDK49 has been released early July. Just wondering if the issue has been there since July or because of some releases of the tools since then (like Metro, expo-metro-config, etc.)

robozb commented 1 year ago

The problem arised 2 weeks ago, I started to use SDK49 one or two weeks before that :)

visto9259 commented 1 year ago

The problem arised 2 weeks ago, I started to use SDK49 one or two weeks before that :)

So something got updated in the last 2 weeks that broke the sourcemap generation. Probably worth for you to log an issue with Expo (https://github.com/expo/expo) with your example above and state that this stopped working about 2 weeks.

In the meantime, I downgraded to SDK48 to continue development.

Are you on Windows or Linux? Building for iOS or Android? I am on Windows and building right now for iOS.

robozb commented 1 year ago

I'm on win10 the destinatios are Android (emulator and real) and IOS->Iphone. Thanks your advices!

visto9259 commented 1 year ago

I saw that you also opened an issue with Expo https://github.com/expo/expo/issues/24273

Let's see what happens... Regards

robhogan commented 1 year ago

Hi folks - Expo does have their own debugging front end and have some Expo-specific transform/serialiser customisations, so if this is only reproducible on Expo(?) it should be looked into over there first - https://github.com/expo/expo/issues/24273.

@byCedric LMK if there's anything we can do on this end.