Skip to content
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

[Bug] After a code change while debugging, VSCode cannot find map source. #1773

Closed
iklein99 opened this issue May 9, 2022 · 19 comments
Closed
Assignees
Labels

Comments

@iklein99
Copy link

iklein99 commented May 9, 2022

🐛 What is the bug? How can we reproduce it?

  1. Start a debug session via "Debug in Exponent".
  2. Make a change in a source file
  3. Get message in Debug console: "Could not read source map for http://192.168.1.26:8081/components/DeviceBlock.bundle?platform=ios&hot=false&strict=false&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true: ENOENT: no such file or directory, open '/Users/iklein99/Library/Mobile Documents/comappleCloudDocs/Node/raz-hub-mobile/components/DeviceBlock.map'"
  4. Run test. Break point is not handled unless you restart the debugger.

Expected behavior

When a code change is made, I would expect the refresh to be handled with no error, and break points still working. I am hoping there is an easy config solution. I haven't been able to find out where Expo stores the .js or .map files.

Debug output

"Could not read source map for http://192.168.1.26:8081/components/DeviceBlock.bundle?platform=ios&hot=false&strict=false&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true: ENOENT: no such file or directory, open '/Users/iklein99/Library/Mobile Documents/comappleCloudDocs/Node/raz-hub-mobile/components/DeviceBlock.map'"

PASTE OUTPUT OF DEBUG CONSOLE (View -> Toggle Debug Console)

</details>

<details>
<summary>React Native output channel</summary>

```text

PASTE OUTPUT OF REACT-NATIVE OUTPUT CHANNEL (View -> Toggle Output -> Select React-Native in ListBox)

[Info] Making sure your project uses the correct dependencies for Expo. This may take a while...

Checking if this is an Expo app......
[Warning] Couldn't read packager's options from exp.json, continue...

[Info] Starting Packager

                                                      
                        #######                       
                   ################                   
                #########     #########               
            #########             ##########          
        #########        ######        #########      
       ##########################################     
      #####      #####################       #####    
      #####          ##############          #####    
      #####    ###       ######       ###    #####    
      #####    #######            #######    #####    
      #####    ###########    ###########    #####    
      #####    ##########################    #####    
      #####    ##########################    #####    
      #####      ######################     ######    
       ######        #############        #######     
         #########        ####       #########        
              #########          #########            
                  ######### #########                 
                       #########                      
                                                      
                                                      
                    Welcome to Metro!
              Fast - Scalable - Integrated


[Info] Packager started.

[Info] Prewarming bundle cache. This may take a while ...

[Info] Building and running application.

No issue with doctor-config-json-not-readNo issue with doctor-npm-versionNo issue with doctor-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-unversionedNo issue with doctor-versions-endpoint-failedNo issue with doctor-invalid-sdk-versionNo issue with doctor-schema-validationNo issue with doctor-validate-asset-fieldsNo issue with doctor-schema-validation-exceptionNo issue with doctor-no-react-native-in-package-jsonNo issue with doctor-legacy-async-storageNo issue with doctor-not-using-expo-forkNo issue with doctor-invalid-version-of-react-nativeNo issue with doctor-react-native-not-installed[Info] Enable JS Debugging

No issue with doctor-config-json-not-readNo issue with doctor-npm-versionNo issue with doctor-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-unversionedinfo Starting custom debugger by executing:, echo A debugger is not needed:  "/Users/iklein99/Library/Mobile Documents/com~apple~CloudDocs/Node/raz-hub-mobile"
No issue with doctor-versions-endpoint-failedNo issue with doctor-invalid-sdk-versionNo issue with doctor-schema-validationNo issue with doctor-validate-asset-fieldsNo issue with doctor-schema-validation-exceptionNo issue with doctor-no-react-native-in-package-jsonNo issue with doctor-legacy-async-storageNo issue with doctor-not-using-expo-forkNo issue with doctor-invalid-version-of-react-nativeNo issue with doctor-react-native-not-installed BUNDLE  node_modules/expo/AppEntry.js 

 BUNDLE  node_modules/expo/AppEntry.js 

 MAP  node_modules/expo/AppEntry.js 

 LOG  JavaScript logs will appear in your environment console
You are now debugging remotely; check your browser console for your application logs.

PASTE OUTPUT OF DEVELOPER TOOLS CONSOLE (Help -> Toggle Developer Tools -> Select Console tab)

Environment

Please tell us about your system and your project:

  • Running VSCode 1.67.0

  • React Native Tools extension version: VERSION 17.0.2

  • Expo 45.0.1

@iklein99 iklein99 added the bug label May 9, 2022
@sontruongna
Copy link

Same issue

@JiglioNero
Copy link
Contributor

Hi, @iklein99, and thanks for reaching us. Could you please clarify which system platform do you use? Also, the version of the extension looks strange, could you clarify it and try to update to the latest.

@StevusPrimus
Copy link

StevusPrimus commented May 10, 2022

Hey, same issue here for all devs in our project. Using React Native Windows with hermes:
image
image
image
image
image
Also important: If I follow the http link, Metro will give me the complete source map in the browser.

@iklein99
Copy link
Author

Sorry, the React Native Tools version is 1.9.2. I am running on Mac OS 12.3.1 using Expo. Both using an actual iphone and the simulator. Same behavior.

@soulnick
Copy link

Same here
Apple silicon
Running VSCode 1.67.0
RNT 1.9.2

@StevusPrimus
Copy link

Hey, same issue here for all devs in our project. Using React Native Windows with hermes: image image image image image Also important: If I follow the http link, Metro will give me the complete source map in the browser.

We could fix this by adding:
InstanceSettings.RequestInlineSourceMap = true;
to App.xaml.cs in the main React Native project

@iklein99
Copy link
Author

@StevusPrimus where would I do that on a mac build for a mobile device? I'm not using Yaml. Not sure where this would go.

@StevusPrimus
Copy link

StevusPrimus commented May 10, 2022

@StevusPrimus where would I do that on a mac build for a mobile device? I'm not using Yaml. Not sure where this would go.

It needs to go in the created platform specific project. I am not sure if there are comparable flags for Android and iOS (or MacOS). Which platform(s) are you building for?

Besides that, did you try yarn start --reset-cache from your root folder already?

@iklein99
Copy link
Author

@StevusPrimus I'm building for mobile (iOS right now). I'm not using yarn, I'm using npm. Here is what my project directory looks like:
Screen Shot 2022-05-10 at 11 46 17 AM

@StevusPrimus
Copy link

You might want to go through this here #328 . But it is not easy to understand and old ... Basically I would explicitly check on this #328 (comment) .

@StevusPrimus
Copy link

And you may want to delete .vscode/.react as well

@sontruongna
Copy link

I can confirm: "inlineSourceMap": true doesn't work, delete .vscode/.react doesn't work. This problem occurs with all my current projects. Both React Native Tools v1.9.2 and React Native Tools (Preview) v2022.4.1421. And when I create a new project with npx react-native init ExapleProject

@soulnick
Copy link

I think is the new versions 1.67.0 and 1.67.1. I downgraded to 1.66.2 and the bug disappeared.

@iklein99
Copy link
Author

Just to be clear, that is the version of VSCode, correct?

@soulnick
Copy link

Just to be clear, that is the version of VSCode, correct?

yes

@JiglioNero JiglioNero self-assigned this May 10, 2022
@sontruongna
Copy link

I think is the new versions 1.67.0 and 1.67.1. I downgraded to 1.66.2 and the bug disappeared.

Exactly. This issue is related to vscode version 1.67. I downgraded to 1.66.2 and the bug disappeared too.

@JiglioNero
Copy link
Contributor

It seems that this bug is related to the latest updates to the vscode-js-debug extension, which is used by our debugging extension. I opened an issue about this in the vscode-js-debug repository. I'll keep this issue open to track progress.

@JiglioNero
Copy link
Contributor

This issue is already fixed in the nightly build of vscode-js-debug extension. So this error will not reproduce in the next version of VSCode

@StevusPrimus
Copy link

I can confirm, the issue is gone since VSC 1.68.0 for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants