Open robozb opened 1 year ago
Hi @robozb! Thanks for the report and log data, I think there are a couple things here:
expo-module-scripts
should only be installed when developing the expo-auth-session
. Unfortunately, VS Code's diagnostic cache is a bit annoying. But, I recommend just closing files you opened from node_modules/expo-auth-session
and run the "Developer: Reload Window" command. It restarts vscode internally, and gets rid of that diagnostic entry.For the first issue, is it possible to send me the initial part of the source map (I don't need all of it, I just want to know the paths defined in that sourcemap).
To get that sourcemap, start Expo and open it on your phone:
http://127.0.0.1:8081/node_modules/expo-router/entry.map?platform=android&dev=true&hot=false&lazy=false
index.js
, it should be something like: http://127.0.0.1:8081/index.map?platform=android&dev=true&hot=false&lazy=false
If neither doesn't work, lmk your Expo SDK version and your entry point.
Dear @byCedric
Thank you so much for your quick answer!
I'l like to focus to the debugging problem. Without the proper source mapping the break points are incomprehensible. I'm at totaly another place in the source code where the real stop is. Can I resolve the problem, do you know any reliable solution or technique, or tools for this task?
I made a public repo for this short test project: https://github.com/robozb/AwesomeProject
Error: Unable to resolve module ./node_modules/expo-router/entry from C:\Users\Beci\Desktop\ReactXepo\AwesomeProject/.:
None of these files exist:
* node_modules\expo-router\entry(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
* node_modules\expo-router\entry\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
at ModuleResolver.resolveDependency (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:114:15)
at DependencyGraph.resolveDependency (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph.js:277:43)
at C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\lib\transformHelpers.js:169:21
at Server._resolveRelativePath (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\Server.js:1045:12)
at async Server.requestProcessor [as _processSourceMapRequest] (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\Server.js:449:37)
at async Server._processRequest (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\Server.js:396:7)
http://127.0.0.1:8081/index.map?platform=android&dev=true&hot=false&lazy=false
Error: Unable to resolve module ./index from C:\Users\Beci\Desktop\ReactXepo\AwesomeProject/.:
None of these files exist:
* index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
* index\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs)
at ModuleResolver.resolveDependency (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:114:15)
at DependencyGraph.resolveDependency (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph.js:277:43)
at C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\lib\transformHelpers.js:169:21
at Server._resolveRelativePath (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\Server.js:1045:12)
at async Server.requestProcessor [as _processSourceMapRequest] (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\Server.js:449:37)
at async Server._processRequest (C:\Users\Beci\Desktop\ReactXepo\AwesomeProject\node_modules\metro\src\Server.js:396:7)
Maybe there is a serious problem I don't know how can I turn on the source maps in React Native Expo project?!
Thank you so much!
Bela
Thanks for the info again @robozb! Ah, I think you can use this link for your project: http://127.0.0.1:8081/App.map?platform=android&dev=true&hot=false
.
I have a fix ready, but I can't reproduce this issue on my machine. So maybe you can help validate the fix for me.
If you add a .vscode/launch.json
file with the following content for your project, and start it through the F5
shortcut or just the play button on the left of VS Code, you can help validate that fix.
{
"configurations": [
{
"type": "expo",
"request": "attach",
"name": "Debug Expo app",
// Instead of using `${workspaceFolder}`, use the actual path with the Uppercased drive letter
"projectRoot": "C:\\Users\\Beci\\Desktop\\ReactXepo\\AwesomeProject",
"bundlerPort": "8081",
"bundlerHost": "127.0.0.1"
}
]
}
⚠️ Note, I re-used the path from the logs you sent above. Please double-check if this is the correct path before opening in your project. It should be the path of your repo that you just sent :)
:tada: This issue has been resolved in version 1.2.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
I just published a pre-release with a potential fix included. You can switch to this version through VS Code, more info here.
Please try version 1.2.1
and let me know if this fixes the issue for you.
🎉 This issue has been resolved in version 1.2.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
Thanks, seems like a semantic release issue. It's this release https://github.com/expo/vscode-expo/releases/tag/1.2.1
My first experience with the new version:
https://github.com/expo/vscode-expo/assets/8656998/021ebb9a-56fd-4a9a-b164-2cdb5127a53a
Thank you!
Same error with absolute path as well:
Dear @byCedric
Wow, it seems It is working but the lack of source maps still exists :(
The real and source debugger points are different :(
Thank you so much for your kind help!
Bela
Thanks for the info again @robozb! Ah, I think you can use this link for your project:
http://127.0.0.1:8081/App.map?platform=android&dev=true&hot=false
.
Wow, you were right, here is the output of this: http://127.0.0.1:8081/App.map?platform=android&dev=true&hot=false
How can I force your debuger tool (VSCode - Expo Tools) to use this maps(?) to handle the debugger point properly?
Thanks, thanks!
I tried a completely new Android Studio, VScode, React Native Expo installation on another machine, the bug is same, the breakpoints is shifted, the debugging is useless :(
https://github.com/expo/vscode-expo/assets/8656998/7f5abb76-3249-4ace-b6c7-ff2861a27418
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:
Interesting but it seems the extension doesn't manage well the source mapping in some cases(SDK48), while the Chrome DevTools works well.
"dependencies": {
"@expo/webpack-config": "^18.0.1",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.8",
"axios": "^1.5.0",
"dotenv": "^16.3.1",
"expo": "~48.0.18",
"expo-auth-session": "~4.0.3",
"expo-location": "~15.1.1",
"expo-random": "~13.1.1",
"expo-status-bar": "~1.4.4",
"expo-updates": "~0.16.4",
"jwt-decode": "^3.1.2",
"moment": "^2.29.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.71.8",
"react-native-maps": "1.3.2",
"react-native-web": "~0.18.10",
"typescript": "^4.9.4"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"babel-plugin-inline-dotenv": "^1.7.0",
"del-cli": "^5.1.0",
"npm-check": "^6.0.1",
"npm-run-all": "^4.1.5",
"openapi-typescript": "^6.5.4"
},
For anyone on Windows trying to work around this. It appears that it is related to project files not being located on the same drive as the VS Code installation. For me it worked to move the project files to the same drive as the VS Code installation.
For anyone on Windows trying to work around this. It appears that it is related to project files not being located on the same drive as the VS Code installation. For me it worked to move the project files to the same drive as the VS Code installation.
Thanks for the info! I have a similar setup, Windows & vscode is installed on C:
, while projects are stored on D:
. With Windows 11, I can't seem to reproduce this at all 🙈
For anyone on Windows trying to work around this. It appears that it is related to project files not being located on the same drive as the VS Code installation. For me it worked to move the project files to the same drive as the VS Code installation.
don't know why this is not mentioned anywhere this is kind of stupid tbh
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!
2023-09-05-04-17-59.mp4 Both demo projects:
The debugger on Expo SDK 49 was broken by a merge in the babel-preset-expo package which inlined environment variables in the sourcemap after the sourcemap had been generated.
Expo 48 depends on ~9.3.2
Expo 49 depends on ~9.5.2
Expo 50 depends on ~10.0.1
https://github.com/expo/expo/pull/25239 was merged in 9.9.0 which fixed the debugger.
A workaround for Expo 49 is to disable EXPO_PUBLIC_
variables - https://docs.expo.dev/versions/latest/config/metro/#disabling-expo_public_-prefixed-client-environment-variables.
Description of the bug
The one-click debuging function doesn't work
To Reproduce
What steps did you perform which led to this issue?
Expected behavior
The Debuger stops at my breaking points
Actual behavior
Nothing happen, doesn't stop at breakpoints, Debug console:
Additional context
Can you further explain the issue? E.g., information about version/environment or screenshots.
Thank you so much: Bela