Why Visual Studio Cordova project always resumes while debugging for parenthesis in index.js - visual-studio-cordova

I've just created a vs-cordova application. When I ripple this application on chrome browser everything works as expected.
BUT,
The debugger breaks on end of cordova.js and index.js. The index.js is below. Break point hits the final bold area. But why? I do not see anything in output area.I opened CLR errors by CTRL+Alt+E ,but didn't help either. I do not see any error on js-output as well. The function is anonymous has no name.So the final parentheses seems fine, isn't it?
Now,I just hit F5 and continue.It's cool but I found this a bit annoying for a while! Especially for android target.It breaks the code for many places. Have you got any suggestion for me ?
BTW, as far as I noticed debugger firstly stops for cordova.js which is added into project when I start debugging then finds index.js.
(function () {
"use strict";
document.addEventListener( 'deviceready', onDeviceReady.bind( this ), false );
function onDeviceReady() {
// Handle the Cordova pause and resume events
document.addEventListener( 'pause', onPause.bind( this ), false );
document.addEventListener( 'resume', onResume.bind( this ), false );
// TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.
};
function onPause() {
// TODO: This application has been suspended. Save application state here.
};
function onResume() {
// TODO: This application has been reactivated. Restore application state here.
};
} )();

This is due to an issue in our web debugging code that surfaced after a recent update to Chrome. It has been fixed in VS 2015 CTP6 that was made available recently. It will also be fixed in our next extension update to VS2013.

Related

How to debug a Next.js hydration error that only shows up in production deployment

I have a nextjs app that gets deployed to Vercel. When running next dev, I have no hydration errors. But when deploying to Vercel, the production build shows several minified react errors.
My problem: I don't know how to debug them. Since the react error is minified there isn't a lot of helpful information.
Does anyone know how disable error minification in such a case or how to get a proper stacktrace?
Unfortunately, there is no good way to debug hydration errors. I had to narrow it down by disabling components and check. It turns out, that the culprit is using
const formatCurrency = new Intl.NumberFormat(undefined,
{ style: "currency", currency: price.currency }
);
I need to specify the locale, so it matches between server and client:
const formatCurrency = new Intl.NumberFormat(process.env.NEXT_PUBLIC_LNG ?? "de",
{ style: "currency", currency: price.currency }
);

NgRx store runtime check NgZone failing on android

We implemented a network check as a side effect with window event online and offline.
online$ = createEffect(() => {
return fromEvent(window, 'online').pipe(mapTo(NetworkActions.deviceOnline()));
});
This works fine in Desktop Chrome and on iOS Safari but somehow results in a strictActionWithinNgZone runtime check on Android:
{
"state": {
"keyboard": {
"isKeyboardOpen": false
},
"network": {
"isDeviceOnline": true
}
},
"error": "Error: Action '[Network] Device Online' running outside NgZone. https://ngrx.io/guide/store/configuration/runtime-checks#strictactionwithinngzone"
},
Does anybody have any idea why this only happens in Android and why it even is a problem to begin with?
Edit:
As far as I understand it, fromEvent(window, '...') should always be inside the zone because zone.js does patch all Browser EventTarget.
Also this is on an Ionic + Cordova App but only when built on Android. Only reason I could see for the difference could be in the Webview it is running in but other than that it is just basic RxJS and Angular
Thanks Pascal
It looks like this was a super specific problem with an Ionic + Cordova App and the Cordova Network Plugin https://ionicframework.com/docs/native/network
This seems to interfere with the Android Platform. Without the Plugins the Error does not occur but the online and offline window events also never fire on Android. So I guess this has nothing to do with NgRx.

React Native error logging with firebase Crashlytics - How to get javascript stack trace

I have a React native application with configured using react native firebase lib and added the module of Crashlytics.
Everything works okay but when i try to log an error using recordError() method or when i just use crash() its just logs errors in the dashboard in native form. I tried to find a way of getting js error to the dashboard but so far nothing has worked.
Is this possible or i should try a different way?
maybe another platform like
bugsnag or sentry?
This is working for me and showing javascript stacktrace:
....
catch (error) {
crashlytics().recordError(new Error(error));
}
you can use react-native-exception-handler to get a js stack trace for the crash and also send js stack trace to firebase crashlytics
like this
import {getJSExceptionHandler} from 'react-native-exception-handler';
setJSExceptionHandler((error, isFatal) => {
if(isFatal)
{
crashlytics().recordError(new Error(error));
}
});

Ionic only works with ionic run android

I have a weird issue with my ionic app, it only works when i run with : 'ionic run android' from my computer (testing) to my mobile. but when i want to run the app from my mobile it dont loads the database (i was using sqlite)
I put my code on onDeviceReady(), it is wrong? (im working without angular, only js and cordova):
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
//console.log('onload');
}
// device APIs are available
//
function onDeviceReady() {
//my main code
}
please, can you help me?

ASP.NET Core RequestDelegate multiple fire

I'm exploring ASP.NET Core Web Applocation empty template. And I'm little bit confused there: if I run the application created by VS new project wizard with no changes and break point on WriteAsync method I could see that it runs two times.
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
Does anybody know if this is normal behaviour or a kind of bug?
You can use logging for diagnosing these kind of issues. You can use the Debug logger to see the log messages in the debug output window.
Add the package Microsoft.Extensions.Logging.Debug to your project.json and do the following in Startup.cs's Configure method:
loggerFactory.AddDebug()
Regarding why you are seeing 2 times, I guess one of the requests is for the fav.ico from the browser.

Resources