React-native Undefined is not an object (evaluating 'RNI18n.locale') - node.js

On every react-native project I try and build (from start kits, to an empty project) the RNI18n error.
None of rht following worked
I get no errors in the console.
I have tried with a fresh (unmodified) react-starter repo
I uninstalled (then re-installed) react native (via npm)
I also posted on their repo without an answer
I tried running from the cmd "react-native run-ios" and from the .xcodeproj file
I am on OSX. Non-react app's work fine.
The error:
2016-09-06 21:48:56.897 [warn][tid:main][RCTEventEmitter.m:54] Sending `websocketFailed` with no listeners registered.
2016-09-06 21:48:56.991 [error][tid:com.facebook.react.JavaScript] undefined is not an object (evaluating 'RNI18n.locale')
2016-09-06 21:48:56.994 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'RNI18n.locale')
2016-09-06 21:48:57.008 [warn][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: The stack is null
2016-09-06 21:48:57.064 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module.
2016-09-06 21:48:57.066 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module.
2016-09-06 21:48:57.072 [warn][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: The stack is null

Reboot was required of my PC. This may be a bug in the current (latest) version (0.39)

I had similar problems on testing with Mocha. But I sent PR and it was approved a while ago (https://github.com/AlexanderZaytsev/react-native-i18n/blob/master/index.js)
There's a chance that your links / libraries on iOS is not properly set. If rnpm link has failed for some reason, maybe you want to read about manual setup (https://github.com/AlexanderZaytsev/react-native-i18n#manual-setup)

First make sure to install the React i18n package:
npm install react-native-i18n --save
Then you need to add the library in xcode, I assume that's what you are missing, here is how:
Right click on Libraries -> Add Files to "Your Project", then search in your node-modules, your react-native-i18n/ios/RNI18n.xcodeproj
Then go to Build Phases -> Link Binary With Libraries, and select the library you just added.
Something like this (I don't have it on my list because I already added ;-) )
I hope it helps, and good luck!!!

Try lowering the version of i18n. This worked for me.

Related

uv_os_gethostname returned ENOSYS using Vue CLI

I am installing a project in vuejs but me display this error does any idea how to solve it.
D:\> vue create crud-app
node:os:68
throw new ERR_SYSTEM_ERROR(ctx);
^
SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_gethostname returned ENOSYS (function not implemented)
at new Defaults (C:\node32\node_modules\#vue\cli\node_modules\#achrinza\node -ipc\entities\Defaults.js:26:20)
at new Parser (C:\node32\node_modules\#vue\cli\node_modules\#achrinza\node-i pc\entities\EventParser.js:8:14)
at Object.<anonymous> (C:\node32\node_modules\#vue\cli\node_modules\#achrinza\node-ipc\dao\client.js:11:19)
Judging by how the window looks in your screenshot, you might be using Windows 7.
If so, the last version of Node.js with official Windows 7 support is either v13.6.0, v13.14.0 or v14 (conflicting sources). You're using v16.14.0, which is too new.
There seems to be a workaround to install newer versions, see here: https://stackoverflow.com/a/64626035
I cannot comment on how well it works, or if it works at all.

Uncaught TypeError: Cannot read property 'id' of undefined at registerNgModuleType

I have a problem that when I clone my repository of the app in angular, after installing the node_module and executing the ng serve it throws me this error and I have already looked for a thousand and one answers but none are correct, the app is from angular 8.1 and my angular global is 11 I do not know if it can influence, but it is with the only angular project that happens to me, at times the ng serve lifts the project and it can be seen but I barely make a modification and I give it save this error appears, I need help that advice me give?
enter image description here
I had the same problem.
I solved the problem by disabled the Angular Language Service for that workspace.
I hope this solves your problem
I could find the error, it turns out that VS code as editor every time I ran the npm install and then the ng serve ran perfect, one time I make a modification and give it ctrl + s it bugea my project and when I run the ng serve me again I get the error, so I had to clone my repository again and work with sublime text and it did not give me the error. It must have been some vscode plugin that makes this happen but it is with very few projects.

electron-builder installer: A JavaScript error occurred in the main process, Error: The specified module could not be found

I am using electron 11.1.0 and electron-builder 22.10.5
I created a installer for my electron app which is using native module using electron-builder and its working fine on my laptop but on my friends laptop I am getting error
A JavaScript error occurred in the main process
Uncaught Exception:
Error: The specified module could not be found.
\\?C:\some\path\My-Electron-App\resources\app.asar.unpacked\node_modules\obs-studio-node\obs_studio_client.node
I have checked C:\some\path\My-Electron-App\resources\app.asar.unpacked\node_modules\obs-studio-node\obs_studio_client.node file exists.
I guess its asar related issue with native module. I tried by adding "asarUnpack": ["**/*.node"] in my build config but does not help.
How can I fix this problem?
I could not get this working with asarUnpack. Instead I use
"asar": false
Increases the bundle size, but at least it works.

JHipster - prod build is not working correctly

I worked a lot on my JHipster project. After 3 weeks I packaged the project again and tried to run the war.
The war is running but the problem is that there is a problem with the frontend. It shows the Hipster error "An error has occured :-(...".
The console logs:
Uncaught TypeError: Cannot read property 'concat' of undefined
at Module.503
I'm just confused because when I run npm start, everything works. I didn't change the webpack or package.json. I'm using the newest JH version.
I solved my issue. We are using index files in Angular. The order of the exports was not correct. We exported the module first and the module tried to access data from the index which was not exported at this time.
Hope I could help you.

react-native attempting to resolve built-in fetch function

I'm attempting to use the fetch function in react-native to grab a piece of data from the web. from what I understand reading the docs, the fetch function is built in to react-native.
when doing so, I get the module resolution error in the attached screenshot, where for whatever reason the react-native bundler is attempting to use the fetch provided by typescript from my ~/.cache directory.
I've previously had typescript 2.6 installed globally via npm, I uninstalled it to see if that might fix things, but the error persists.
I should note that the only things I've done for this project are to create it with create-react-native-app, add a little snippet to the App.js component stolen from the react docs to fetch some JSON, and yarn run eject the project (this error persisted before and after the ejection)
well in my turkey-induced frenzy, it appears I hadn't properly uninstalled the global typescript install on my computer.
having done so properly, the issue is resolved;
however the issue of react-native's module resolution strategy being incompatible with a global typescript installation persists.

Resources