Giter Club home page Giter Club logo

Comments (9)

erez-unitronics avatar erez-unitronics commented on May 13, 2024 1

I upgraded react native version from 0.69.3 to 0.69.4 (which released yesterday) and the error gone

from applicationinsights-react-native.

MSNev avatar MSNev commented on May 13, 2024

@erez-unitronics can you provide some more context?

As ApplicationInsights (v2) provides support for es3 runtimes I don't believe that we have defined any group "names" but the SDK does attempt to crack the stack by using these regex's

https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCommon/src/Telemetry/Exception.ts#L581

This one is to try and get the real "custom" error name
https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCommon/src/Telemetry/Exception.ts#L270

If it is the stack that is not being parsed correctly the if you could provide a couple of examples we should be able to update to support (assuming I'm guessing the issue correctly). Once fixed and released in AI react-native should pick up the newer version without needing a new release.

The actual exception processing was last changed in v2.6.3 as part of fixing issue #363 (in App Insights repo)

from applicationinsights-react-native.

erez-unitronics avatar erez-unitronics commented on May 13, 2024

@MSNev thansk for the reply

Here is my code: (Which works perfectly on v2)

import { ApplicationInsights } from '@microsoft/applicationinsights-web';
import { ReactNativePlugin } from '@microsoft/applicationinsights-react-native';

import { AZURE_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY } from '../../../config/Config';

var RNPlugin = new ReactNativePlugin();
var ai = new ApplicationInsights({
config: {
instrumentationKey: AZURE_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY,
extensions: [RNPlugin]
}
});
ai.loadAppInsights();

export const trackEvent = (eventPath, message) => {
ai.appInsights.trackEvent(
{
.....
});
};

And this is what i am getting when app is starting: (Android and IOS)

Screen Shot 2022-08-04 at 9 57 35

from applicationinsights-react-native.

MSNev avatar MSNev commented on May 13, 2024

Hmm, I've just looked at the changes from 2.5.6 to 3.0.0 and there are no new Regex's added by ApplicationInsights.

The biggest change is that v3 now uses ReactNative v0.69.3 and also properly supports the latest react-native-device-info...

So I don't think this issue is directly coming from the plugin ( and as v2.5.6 uses the same version as ApplicationInsights there either)....

Is there any more details that you can obtain from the "Unhandled Exception" that would help narrow down the source of this regular expression? -- Like a stack trace or if you can repo in an environment where you can set a breakpoint.
If it contains the actual "invalid" regex that would also help narrow down the source to see if we have that RegEx in any of the source code that we control...

from applicationinsights-react-native.

erez-unitronics avatar erez-unitronics commented on May 13, 2024

here is some logs from logcat:

08-07 16:11:14.745 5567 7028 E unknown:ReactNative: Exception in native call from JS
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: com.facebook.react.devsupport.JSException: Invalid regular expression: invalid group specifier name
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at android.os.Handler.handleCallback(Handler.java:755)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at android.os.Handler.dispatchMessage(Handler.java:95)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at android.os.Looper.loop(Looper.java:154)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: at java.lang.Thread.run(Thread.java:761)
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: Caused by: com.facebook.jni.CppException: Invalid regular expression: invalid group specifier name
08-07 16:11:14.745 5567 7028 E unknown:ReactNative:
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: no stack
08-07 16:11:14.745 5567 7028 E unknown:ReactNative: ... 7 more

I am using node v16.10.0 if it helps

from applicationinsights-react-native.

MSNev avatar MSNev commented on May 13, 2024

I think its probably related to this React Native Issue
facebook/react-native#30714

Can you try and confirm to see if you can "see" the actual regular expression (as in the screen dump in the react native issue). As part of trimming, I believe that we have the same regex (which works in a browser).

from applicationinsights-react-native.

MSNev avatar MSNev commented on May 13, 2024

Just went searching across the ApplicationInsights code base looking for any "look-behind" instances and there are none in any of the currently released versions (we were going to use this in the upcoming beta's). So it would be really good if you could identify the specific regex that is causing grief.

I searched for ?< (look-behind) and ?= (look-ahead) to try and identify any possible regex that might be causing this.

from applicationinsights-react-native.

MSNev avatar MSNev commented on May 13, 2024

After doing some more reading to try and track this down I found another possible related issue facebook/react-native#29271

from applicationinsights-react-native.

github-actions avatar github-actions commented on May 13, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from applicationinsights-react-native.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.