Issues with Debugging Kotlin/Js Project on Chrome - kotlin-js

So I recently started experimenting with Kotlin/Js with react and one of the issues that I ran into involves some errors regarding Uncaught Type Error at RouterDOM but all the sources I get are JavaScript and I cant see any source sets kotlin mappings for the errors
just the js executable.
So I have gone through the Kotlin Documentation for debugging Kotlin/JS code and also tried enabling Javascript source sets

Related

Debug and Hot Reload not working with NativeScript in VS Code

I have just installed NativeScript and the VS Code extension for it, and built a sample 'empty' Vue app as directed.
The build worked with no errors (although took a long time!) and the basic app is running on my Android device. But breakpoints don't work , and changes in the .vue files are not being hot-reloaded to the device. The debug console has
Successfully applied update
whenever i make a change (just a small message text edit) but nothing happens on the device. But I also have this error in the console:
Error when trying to require webpack.config.js file from path 'C:\Users\quilk\source\repos\NStest\nstest\webpack.config.js'. Error is: Error: Cannot find module 'C:\Users\quilk\AppData\Local\Programs\Microsoft VS Code\package.json'
and sure enough, there is no package.json at that location.
Running the command tns doctor reports no errors.
There's a similar question here but it's 4 years old and maybe things have moved on since then?
I can probably work without hot reload, but debugging with breakponits will be essential.

Blank screen when building React Native app in release mode of android

I am building a React Native app and it works fine in debug mode, but when I try to build it in release mode, it shows a blank screen. I have tried several things to troubleshoot the issue, such as updating my dependencies and checking for any syntax errors, but I haven't been able to find the cause of the problem. I am not seeing any error messages, and the app seems to be working as expected in debug mode.
I am not sure what is causing the issue in release mode, and I would appreciate any help or suggestions.
Here is what I have tried so far:
I have checked that my React Native dependencies are up-to-date and correctly configured.
I have ensured that the bundle is being correctly packaged in the binary APK.
I have verified that there are no syntax errors in my code.
Use this error handler https://github.com/a7ul/react-native-exception-handler to catch problems in production. It supports both JS and Native side errors

Debugging React Native app having React Native Reanimated with Vscode: TypeError: global.performance.now is not a function

I'm tasked with an already-started project that has React Native Reanimated library as a dependency.
Whenever I debug my app with Vscode/Chrome debugger, when I navigate to any screen that has components depending on Reanimated, I keep getting global.performance.now is not a function.
I've already seen TypeError: global.performance.now is not a function in react native but in the latest version it is already changed to what the accepted answer to the question suggests.
I've tried downgrading react-native-reanimated to 2.2.4 and patch as suggested in the answer, yet then I start getting all sorts of errors like Property ' stopObservingProgress' doesn't exist.
I've also tried 2.3.1, also different yet blocker errors.
I've also tried with and without Hermes.
Disabling debugging gets rid of the error, but I (obviously) can't debug. Debugging with Flipper works yet debugging with Flipper is extremely slowing my workflow (e.g. switching between Vscode and Flipper and trying to find files to put breakpoints, unable to edit at the same place where I debug etc. Flipper is just not my thing) and I want to debug with Vscode, which works perfectly without Reanimated.
I want to get rid of Reanimated library but unfortunately there is already a lot of code that relies on it, including a library with no other alternative that directly depends on Reanimated.
How can I debug an app containing React Native Reanimated with Vscode?
It's still a known and open issue when we are using reanimated version 2.., you can find this in reanimated documation.
As the library uses JSI for synchronous native methods access, remote debugging is no longer possible. You can use Flipper for debugging your JS code, however connecting debugger to JS context which runs on the UI thread is not currently supported.
For now only flipper is the way of debugging react native apps that using JSI for syncronous native module calls.
Okay after further investigation I've found out that this is indeed possible. There were some other problems with latest versions of some of the dependencies that I've been using, which was masking the original issue. With the right combination of dependencies and following https://fbflipper.com/docs/extending/debugging/ and https://thinhtran3588.medium.com/make-professional-mobile-apps-with-react-native-and-typescript-debug-your-application-with-vscode-fba067f77445 I was able to debug my app correctly using Vscode debugger.

React native app sourcemaps show incorrect location of error when error happens in asynchronous code

I have a react-native app. I recently moved to react-native version 0.61.5 for which I took the long route of creating a new react-native app and porting my code over to avoid any linking issues since new version used PODFILE as the default linking mechanism. Ever since I moved to version 0.61.5, I don't get the correct location of code in error logs. I think this is mainly happening when the code is running in asynchronous fashion which most of the code is. For e.g., look at below screenshot:
It is reporting that it is not able to call map on some array which is apparently undefined but the place where the error is reported is completely incorrect. I have no such file in my codebase and it is probably pointing to some file in some react-native package.
I am using Sentry #sentry/react-native": "^1.1.0". I don't think Sentry can cause issue with the sourcemaps reported during development.
I am not sure how to debug this problem. This problem is causing a lot of issues in debugging any errors as I have to manually figure out where the error happened. Please let me know if you have any tips on how to fix this problem.

default compilation sdk eroor

I'm having some errors while building an android react-native project regarding SDK compilation.
I've tried environment variable change, node.js change, and gradle wrapper change already.
Could not get unknown property 'DEFAULT_COMPILE_SDK_VERSION' for object of type com.android.build.gradle.LibraryExtension.