Error while importing local native module package - react-native

I'm new to React Native as such i need some help with a rather interesting problem. I'm trying to create a native module library to wrap some native ios/android api's. I followed some examples on the react site to do this but the issue i'm running into is how to package my created module so i can import the code into another react native app.
This is the error i'm running into while trying to use my newly created module.
TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[7], "simple").DeviceModule.increment')
I create the package via npm pack, it generates a .tgz file which i attempt to install into my sample app via npm install but the end result is the error message above.
When attempting to use the module in my code i use the following: import { DeviceModule } from 'simple'; and this generates a warning:
Could not find a declaration file for module 'simple'. '/Users/aqureshi/Projects/React/ScanForensicsDemo/node_modules/simple/index.js' implicitly has an 'any' type. Try npm i --save-dev #types/simple if it exists or add a new declaration (.d.ts) file containing declare module 'simple';ts(7016)
So i'm not sure where to go from here, also worth mentioning that I created the native module via another RN "App" project, because when i try to create a library via create-react-native-library it would not work either.

Related

import video.js into nuxt.js application not working

I'm trying to use video.js in a Nuxt app. I ran yarn add video.js, which installed video.js and I can see it in package.json
In my page video.vue I added
import videojs from 'video.js'
vscode returns this error:
Could not find a declaration file for module 'video.js'. '../node_modules/video.js/dist/video.cjs.js' implicitly has an 'any' type.
Try npm i --save-dev #types/video.js if it exists or add a new declaration (.d.ts) file containing declare module 'video.js';
I followed the example on the official page for vue: https://videojs.com/guides/vue/

Im getting a error about in a manifest json i cant locate when serving my vue project

So this is the error i get when i open my vue project... except that i cant even locate my manifest.json nore do i have a /img/icons folder in the project. I cannot figure out what the error is or how to correct it
Error while trying to use the following icon from the Manifest: http://localhost:8080/img/icons/android->chrome-192x192.png (Download error or resource isn't a valid image)
The error you're seeing is typically caused by altering a project created using Vue Cli 3's command vue create some-project and then removing either parts of or in its entirety the public folder. Namely, the error complains about the absence of icon files situated in public/img/icons, aimed at providing android, apple or web icons/favicons for the served/built app.
A possible fix for this error is to create a new project (run vue create whatever outside of your project) and copy-paste the resulting public/ folder into your current project.
If you haven't created your project with Vue Cli 3, the solution above will likely not work.
For Vue Cli 2.x projects, according to Vue Cli docs running vue init webpack my-project in the root of the project (where my-project is the name of your project as set in package.json) might work.

Implement Typescript with React admin

I did: create-react-app with --typescript flag
Then install react admin version 3.0
and I got this in console:
Could not find a declaration file for module 'react-admin'.
'.../node_modules/react-admin/lib/index.js' implicitly has an 'any' type.
Try `npm install #types/react-admin` if it exists or add a new declaration (.d.ts)
file containing `declare module 'react-admin';`
Any advice please or a guide please?

Using jest and react native: "Cannot find module 'ErrorUtils' from 'index.js'"

I'm just starting out using Jest with React Native. We've already built out a bunch of our apps. I'm trying to just run the default tests provided by React Native and am getting an error:
Cannot find module 'ErrorUtils' from 'index.js'
for each of __tests__/index.ios.js and __tests__/android.ios.js. ErrorUtils is a standard React Native module that I'm importing in my top-level index.js file, which is in turn imported from the above two test files.
In the RN 63, deleting any references to ErrorUtils worked fine. (There was an unnecessary line mocking it in the jestSetup file.)

"require is not defined" in Vue.js

I have installed vue-star-rating module with npm. I want import this module in my JS file
var StarRating = require('vue-star-rating');
When I hover on 'vue-star-rating' shows full path to module and module also exists in noe_modules folder, but when I run my app in console I get a
ReferenceError: require is not defined
message. I have tried also other methods to import, but it still doesn't work.
import StarRating from 'vue-star-rating'
Also, you will need something like Webpack to compile and create the bundle properly. It will not work without a bundler.
Are you using a compiler to generate a bundle?
You can't reference modules this way as require doesn't exist on the client. You need to use something like fuse-box, webpack, etc. to properly handle the require function and include the modules you're referencing in your client bundle.