Parse Server with React Native - react-native

I'm trying to integrate Parse server with React native, so I followed the documentation and I added parse/react-native package but it keeps throwing this error "TypeError: _reactNative3.default.setAsyncStorage is not a function
Here is my snack for more details https://snack.expo.io/BkWo7v7sG

This error means that your Parse SDK is not installed / imported correctly.
This is true because in your package.json you are using
"parse/react-native": "1.11.1"
which is not a package.
You need to install Parse via npm / yarn as yarn add parse or modify your package.json as
"parse": "1.11.1"
, and follow the steps, then it would work.

Related

Error with Pods in React Native monorepo using Turborepo and Yarn Workspaces

Here's a suggestion for a Stack Overflow question description and title to help you open an issue with your React Native monorepo using Turborepo and Yarn workspaces:
Title: Error with Pods in React Native monorepo using Turborepo and Yarn Workspaces
Description:
I'm trying to set up a monorepo for a React Native project using Turborepo and Yarn Workspaces, but I'm encountering an error with Pods. The error message is:
An error occurred while processing the post-install hook of the Podfile.
No such file or directory # rb_sysopen - ../node_modules/react-native/package.json
I've tried various approaches to resolve the issue, such as symlinking the node_module/react-native directory, but so far nothing has worked. I'm hoping to find a solution to this issue, or to better understand what might be causing it.
Has anyone else encountered this error when using Turborepo and Yarn Workspaces in a React Native monorepo, and if so, how did you resolve it?
This happens, because you have to tell Cocoapods where to find the react native package. Per default it will look one dir above (./..) which is not correct after re-organizing your codebase with yarn workspaces.
If you moved your project like this app => apps/app then you have to change 3 things in the Podfile
1/2: Add "../../" to require_relative, should be at line 2 and 3 in your podfile
3: Add react_native_path argument to react_native_post_install
require_relative '../../../node_modules/react-native/scripts/react_native_pods'
require_relative '../../../node_modules/#react-native-community/cli-platform-ios/native_modules'
...
react_native_post_install(
installer,
react_native_path = "../../../node_modules/react-native",
:mac_catalyst_enabled => false
)

Adding #bam.tech/react-native-batch to a fresh new react native project does not work

I try to yarn add #bam.tech/react-native-batch but I got the following error:
node_modules/#bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNUtils.java:113: error: no suitable method found for put(String, batchEventData.put(key, URI.create(valueMap.getString("value")));
and
node_modules/#bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNBatchModule.java:529: error: no suitable method found for setAttribute(String, editor.setAttribute(key, URI.create(url));
while doing yarn android (no error on iOS)
I am using react 18 and *react-native 0.69.1

Vue JS plugin using rollup and p11n not building import files that are not javascript error

I'm using Vue JS to build a plugin and am using the p11n module. I've built my components and everything works fine when serving via npm run serve, but when trying to build the project via npm run build which essentially is running: vue-cli-service build I get the following error regardless of what version I use:
ERROR Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
at error (/Applications/MAMP/htdocs/application-compiler-gui/node_modules/rollup/dist/shared/node-entry.js:5400:30)
at Module.error (/Applications/MAMP/htdocs/application-compiler-gui/node_modules/rollup/dist/shared/node-entry.js:9824:16)
at tryParse (/Applications/MAMP/htdocs/application-compiler-gui/node_modules/rollup/dist/shared/node-entry.js:9717:23)
at Module.setSource (/Applications/MAMP/htdocs/application-compiler-gui/node_modules/rollup/dist/shared/node-entry.js:10080:33)
at Promise.resolve.catch.then.then.then (/Applications/MAMP/htdocs/application-compiler-gui/node_modules/rollup/dist/shared/node-entry.js:12366:20)
No idea how to fix this, I've tried installing the Vue JS rollup plugin, no luck :(

appcenter error build for reactnative, looking for index.ios.js

I have a react native project that I want to use appcenter with,
when building the project, I get the following error:
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /Users/vsts/agent/2.155.1/work/_temp/4371836d-ad98-4059-84bc-f7bc51688d63.sh
Found index.ios.js for ReactNative index.
warning: the transform cache was reset.
error The resource /Users/vsts/agent/2.155.1/work/1/s/index.ios.js was not found.. Run CLI with --verbose flag for more details.
[error]Bash exited with code '1'.
But my react native project was created with expo, and in new schema after ejecting there is no index.ios.js or index.js
I also found this entry talking about it,
but dont understand yet how to add the index.js script
https://github.com/microsoft/appcenter/issues/189
thanks
This is a known issue and being track in GitHub. There is also a documented workaround on the GitHub Issue.
https://github.com/microsoft/appcenter/issues/189

React native link fails with no package found

I'm not sure what exactly is happening but I am unable to run react-native link without errors occuring
CLI Output:
react-native link --verbose
debug Available platforms: iOS, Android
debug Targeted platforms: iOS, Android
debug Getting project config for iOS...
debug Getting project config for Android...
error No package found. Are you sure this is a React Native project?
error Unexpected close tag
Line: 22
Column: 24
Char: >
debug Error: Unexpected close tag
Line: 22
Column: 24
Char: >
at error (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:666:10)
at strictFail (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:692:7)
at closeTag (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:885:9)
at SAXParser.write (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:1447:13)
at new XmlDocument (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/lib/xmldoc.js:199:15)
at readManifest (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/tools/android/readManifest.js:44:10)
at Object.projectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/tools/android/index.js:66:46)
at Object.keys.forEach.platform (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/commands/link/getProjectConfig.js:25:62)
at Array.forEach (<anonymous>)
at getProjectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/#react-native-community/cli/build/commands/link/getProjectConfig.js:22:35)
This randomly started happening after attempting to npm install react-native-firebase.
What I've tried
clear-caches
remove node_modules and npm install
Checking out my code back to a previous commit
Adding my package name to the manifest locaed in /android/app/src/debug/AndroidManifest.xml
Removing the app from my computer and cloning it from github
Running react-native link on another project, which works, but i just can't run react-native link on this specific project.
So the answer to my question was that in my android manifest xml file, there was an incorrect closing brace for one of my intent filters.
So for anyone that this happens to ensure that all of your Android files have correct syntax.
I fixed this problem by closing some unclosed tag in android/app/src/main/androidManifest.xml. Try checking the file line by line.