How to set application version on the Sentry error capturing? - javascript

Recently, I installed Sentry on my React Native application. I set my initializing configuration like below:
import { SentryToken } from './app/helpers/config';
import { environment } from './app/helpers/env';
Sentry.init({
dsn: SentryToken,
environment,
});
And on the issue dashboard, I can see all errors, messages and etc.
But in one of the message report I saw the Sentry reports whole the device, OS and especially the application:
Actually, I wanna know where does the version come from?
I even pass the version key but still, it doesn't make any difference the version in the Sentry dashboard is still on 1.0`.
I read whole the documentation about options but there is nothing to help me.
where does the version come from?

Finally, I find out sentry brings the Version and the Build number from Xcode:
Actually, these two numbers come from the info.plist file and project.pbxproj file with the following file:
info.plist: ios/[projectName]/Info.plist
project.pbxproj: ios/[projectName].xcodeproj/project.pbxproj

Related

NativeScript Version 8.2.1 : how to use old outdated plugins

I am new to NativeScript and Webpack and i have migrated my native script app from 6.5.1 to 8.2 version, and i am using nativescript-orientation-free plugin ,i am getting build errors as this plugin still refers to tns-core-modules which is no longer supported in Native Script 8 and i am getting below errors
ERROR in ./node_modules/nativescript-orientation-free/orientation.js 17:12-48
Module not found: Error: Can't resolve 'tns-core-modules/ui/enums' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'
ERROR in ./node_modules/nativescript-orientation-free/orientation.js 18:12-48
Module not found: Error: Can't resolve 'tns-core-modules/ui/frame' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'
we do not want to use this paid version pro-plugins-nativescript-orientation
can you please let me know how can i fix this issue? is there anything i can do in the webpack.config.js ? I am stuck here.
You have my sympathies. (A quote from the movie Alien.)
Migrating a NativeScript app from 6.5 to 8.x can be wildly frustrating due to all the breaking changes. Make sure you watch this video: Migrating Legacy NativeScript 6 Project to 8.
When Migrating my app I found I had to migrate several of the plugins I used. Patch-package is your friend! To answer your question, you'll need to revise the links you circled. Sometimes this is easy, sometimes this requires investigation.
These three should work:
import { Application as application } from '#nativescript/core';
const Enums = require("#nativescript/core/core-types").Enums;
import { Frame as frame } from '#nativescript/core';
I expect these two should work, 'tho I didn't use them in my project:
import { Page } from '#nativescript/core';
import { View as view } from '#nativescript/core';
Good luck!
i removed this plugin and able to set the orientation without any third party plugins using
UIDevice.currentDevice.setValueForKey(1, "orientation");

'ActionSheetIOS' is not exported from 'react-native-web/dist/index'

How to avoid the this kind of warning?
My app is working but it gives warning in terminal like below
Compiled with warnings.
/home/karim/Desktop/React-Native/RN-Complete-Guide/node_modules/react-navigation-header-
buttons/src/overflowMenuPressHandlers.js
Attempted import error: 'ActionSheetIOS' is not exported from 'react-native-web/dist/index'.
It is because of of I imported HeaderButtons and HeaderButton from react-navigation-header-buttons like below
import { HeaderButtons } from "react-navigation-header-buttons";
import { HeaderButton } from "react-navigation-header-buttons";
And I am using react-native 4.x veriosn. is there any way to avoid this warning?
This file in the source for react-navigation-header-buttons imports ActionSheetIOS, which is not supported by React Native web applications. This seems like it's probably an issue with React Native web itself, as even importing the ActionSheetIOS component in your project without actually using it will cause a crash from my past experience.
You probably won't be able to use react-navigation-header-buttons for your solution because of this issue. The authors also go on to say in their README that web support is currently experimental:
Supports iOS and Android, web support is experimental.
I'd suggesting either finding a way to avoid this library or flag an issue on the repo to suggest swapping ActionSheetIOS in with a cross-platform action sheet solution like react-native-action-sheet.
in react-native-web/dist/index.js i exported
export { ActionSheetIOS }; and somehow the warning disappeared

TypeError: Restivus is not a constructor in Vulcan project

I have tried to add the meteor package nimble:restivus to my Vulcan project (which runs on meteor). When I add the following code:
import {Restivus} from 'meteor/nimble:restivus'
var Api = new Restivus ({
useDefaultAuth: true,
prettyJson: true,
});
export default Api
I get the error TypeError: Restivus is not a constructor when i build my app. I have tried adding the older version according to this: https://github.com/kahmali/meteor-restivus/issues/290 but still no luck. If i remove the curly brackets from import {Restivus}, still no luck. Spent days trying to figure this out, does anyone know how to solve this?
To anyone else that has this problem, I have spoken to the Vulcan team and there are a number of meteor packages that don't work with Vulcan. Don't ask me how many or which ones, as they didn't specify and I'm not sure why they don't work. I was told however, that npm packages are preferred, so you should use these over meteor packages if possible.

Attempting to load a JavaScript sdk into an Angular2 application. Can't find all dependencies

I'm attempting to make use of this library: https://github.com/MagicTheGathering/mtg-sdk-javascript in an Angular2 application.
Unfortunately, I've been going in circles trying to load it into my application.
Firstly, on the TypeScript side if I import it using:
import { } from 'mtgsdk';
there are no types to load into the {}.
If I attempt to load it using something similar to:
import * as mtg from 'mtgsdk'
I'm unable to because it says that it's unable to find a module named mtgsdk.
I've installed the module using
npm install --save mtgsdk
Also, npm installs work fine for other modules.
The application compiles fine if I load it in using require via something similar to this:
var mtg = require('mtgsdk');
Taking that approach, I'm able to compile and launch but in the browser I get a number of errors about modules that it can't find. I figure they are prerequisites for the sdk that didn't get loaded so I start bringing them in via package.json.
For every one that I bring in, I then have to go to systemjs.config.js and add an entry pointing to the module's entry point and often have to specify a default extension using blocks like this:
pointer
'mtgsdk': 'npm:mtgsdk/lib/index.js',
'request-promise': 'npm:request-promise/lib/rp.js',
'ramda': 'npm:ramda/dist/ramda.js',
'emitter20': 'npm:emitter20/index.js',
'bluebird': 'npm:bluebird/js/browser/bluebird.js',
'request': 'npm:request/index.js'
default extension
'request-promise':
{
defaultExtension: 'js'
}
I'm not sure if that's the right approach though because the more dependencies I add, the more that I end up requiring. At one point I had literally gotten up to 50 extra dependencies added because every time I launched, the browser console would find more that were needed.
Is there any easier way to load all of these in?
Also, some of them (such as tough-cookie and request-promise-core) were very problematic to load and I couldn't get the browser console to stop complaining about them. Finally, some of them seemed very basic such as url, http, https. Those seem like they should already be present.
Using systemjs was utilized in the previous versions of Angular 2, However Angular 2 has evolved to Angular 4, with super new features like Angular CLI.
I recommend your use Angular CLI, with #angular/cli.
Importing Node modules
Since mtgsdk is a node-module, you can easily import it using
import * as mtg from 'mtgsdk'
However for your program to compile, you must install a type definition for it. or declare one for it in /typings.json or your app might not build.
Importing Client Scripts
For client scripts like firebase.js you won't need to add client scripts as entries in systemjs.config.js again.
Using #angular/cli, you would easily add them in the scripts[] array in your angular-cli.json for automatic compilation.
Then access them like this
declare const firebase: any;
Here is a quickstart tutorial to set up Angular with #angular/cli.

Trouble using auth:import function from firebase-tools package as a node.js module

Currently, I am trying to import users with already hashed passwords into Firebase by solely using the 'firebase-tools' package. I am able to list my current projects by using the command:
client.list({
token:fbToken
}).then(function(data){
console.log(data);
});
but am unable to import any users when trying to use the auth:import command.
client.auth:import({
account_file: "driverList.json",
project:"projectName",
token: fbToken,
hash-algo: "BCRYPT"
}).then(function(data){
console.log(data);
});
I believe that this is because the CLI syntax for auth import is not easily translatable to javascript like the other one word commands (list, logout, etc.). I've tried looking at the documentation, but had no luck.
Does anyone have any idea how to go about this issue? Here is a link to the git repo.
I was having trouble with this as well, and it took literally digging around in the library to try and find answers. In the index.js file here you can see alias' for the listed bash commands. So for auth:import you should call client.auth.upload. However I have yet to find any documentation on the arguments you need to use for the node functions. I suspect they are buried in their corresponding alias here, but not even the deploy function there lists the arguments they use for it in the README. If someone finds any documentation on using arguments, I'd love to know as well.

Categories

Resources