text:
Prevent prop mutation on item resize (#1155)

When adding a new item to the dashboard and resizing it immediately, props will be mutated here. When using a library like immer, the app will crash with the following exception:
Uncaught TypeError: Cannot assign to read only property 'w' of object '#<Object>'
  at ReactGridLayout.onResize (ReactGridLayout.js:614)

This is very similar to #1063 , but it's affecting another part of the code base (and is triggered by a different user action).
I've fixed the issue by cloning the active resize item in onResize (where the issue occurs) and updating that item in the layout in onResizeEnd. I had first tried cloning the entire layout in onResize (to prevent the temporary activeResizeItem), but this is highly ineffective, as it's executed on every mouse move.
I have confirmed the fix in my own project.
Fixes: #1155

Thanks. I think a more comprehensive fix is needed here, to eliminate the state items oldResizeItem, and oldDragItem, and simply pluck them back out of the oldLayout.

@darekkay I could really use a test that fails with the current code. You can use something like a deep Proxy freeze:
// Deep freeze an object by using a Proxy.
// This is better than Object.freeze() as we can create coherent error messages
// and easily only deliver frozen subobjects when they are accessed. We can
// even add custom logic, like warning if you access a property that doesn't exist.
/* eslint-disable no-console */
export function deepFreeze<T>(inputObj: T): $ReadOnly<{|...T, toJSON: () => T|}> {
  // Our handler that rejects any change to the object and any nested objects inside it
  const deepFreezer = {};
  deepFreezer.get = function get<T: Object>(obj: T, prop: $Keys<T>, _receiver: Proxy<T>) {
    // Clone w/o Proxy
    if (prop === 'toJSON') return () => obj;
    // If dealing with nested object, nest the proxy untill it reaches the direct property of it's parent proxy
    if (typeof obj[prop] === 'object' && obj[prop] !== null) {
      return new Proxy(obj[prop], deepFreezer);
    }
    // If prop is directly accessible, just do the default operation
    else {
      if (!(prop in obj) && typeof prop !== 'symbol' && prop !== 'length' && prop !== '__esModule') {
        const stack = new Error().stack;
        logger.error(`Can not get unknown prop "${prop}" on frozen object. Stack: ${stack}`);
      }
      return obj[prop];
    }
  };
  deepFreezer.set = function set<T>(obj: T, prop: string, _val: any, _rec: Proxy<T>): boolean {
    const stack = new Error().stack;
    logger.error(`Can not set prop "${prop}" on frozen object. Stack: ${stack}`);
    // Note that we could return false, since returning false will create a TypeError,
    // but this could halt the whole program.
    return true;
  };
  // $FlowIgnore for all useful purposes the output type is T here
  return new Proxy(inputObj, deepFreezer);
}

Any new development on this?

Still waiting on a test so we can be sure this doesn't regress.

Can I help for something?

Sure. If you have a patch that adds a regression test here (i.e. fails on the old code, passes here), we can combine it with this and merge.

Most of the work is done in the component (onResize and onResizeStop) and you just test the utils. I can write a test for the new getLayoutItemIndex, but without Enzyme, it will be difficult to test the component itself.

I don't understand how you test the component in this repo since most of the work is done in the component ReactGridLayout.

Yes, we already use enzyme in https://github.com/STRML/react-grid-layout/blob/master/test/spec/lifecycle-test.js.

Good! I'll try something soon

I just tried this fix, and it creates a box overlapping

So, the fix provided don't work and give more bugs. I will not extend more on this because it's not a bug with react-grid-layout but with the data provided to the layout props.
I found that if you use Immer, you can use setAutoFreeze(false) to don't make your data readonly.

So, the fix provided don't work and give more bugs. I will not extend more on this because it's not a bug with react-grid-layout but with the data provided to the layout props.

@DWboutin Thanks for checking this! Unfortunately, I don't have time to look into it again in the coming days. It is working fine for my use case (in production for weeks), but I agree that I might have missed some other use cases. However, it is a bug within react-grid-layout, because React props are considered immutable (i.e. one should not mutate them):

Whether you declare a component as a function or a class, it must never modify its own props.

I found that if you use Immer, you can use setAutoFreeze(false) to don't make your data readonly.

This is a workaround for this bug, but it just hides the core issue as mentioned above. It might also have other unwanted effects.
Could you maybe describe what's exactly broken with my PR? So I (or someone else) can build upon it instead of dismissing the whole issue.

Anything I can do to help get this PR approved and merged? I'm seeing the same issue as well, and would like to help with this.

@christiankaseburg As @DWboutin mentioned, my PR seems to be introducing new bugs. So either those new bugs have to be fixed or a new PR with a different approach is required. In addition to that, some unit tests are required.

@darekkay Do you have a work around for this temporarily? I am storing the layout in redux, and I am coming across issues with this error whenever trying to resize a grid-item.

The same issue.
Tried to find a way how immutable layout gets into ReactGridLayout's state, but didn't have enough time.
However created a (sandbox)[https://codesandbox.io/s/react-grid-layout-error-8vxg0?file=/src/index.tsx] that reproduces this error. Probably it can be useful for someone who wants to help with this fix :)

Experiencing the same issue. Would love if this was fixed. Setting setAutoFreeze(false) for me somehow only works after updating the layout at least once. The first resize action is still triggering
Uncaught TypeError: Cannot assign to read only property 'w' of object '#<Object>' at ReactGridLayout.onResize (ReactGridLayout.js:614)

Experiencing the same issue. Would love if this was fixed. Setting setAutoFreeze(false) for me somehow only works after updating the layout at least once. The first resize action is still triggering
Uncaught TypeError: Cannot assign to read only property 'w' of object '#<Object>' at ReactGridLayout.onResize (ReactGridLayout.js:614)

Is there any traction on this issue? I am unable to find a way to initiate setAutoFreeze(false) has that been deprecated?

Has this been fixed in the latest version please?

authors: Anwardo DWboutin QiuYeDx STRML christiankaseburg darekkay garipov jaguardo

repo: react-grid-layout/react-grid-layout


text:
Language tweaks for useFieldArray

Make it clearer that defaultValues is required for every field in the array.
Provide examples for using field.id as the component key.
Spelling fixes

I edited this directly on GH so please excuse any formatting issues.
Related to https://github.com/react-hook-form/react-hook-form/issues/3335

Thanks @pmaier983 for the review and adjustment. :hear

thank you @terebentina for the doc improvement 👍 ❤

oops, early morning mistake... try to hit the merge button but clicked close with comment...

source: gharchive/pull-request

repo: react-hook-form/documentation

license: MIT

license_type: permissive

license_source: github-api


text:
A problem occurred configuring project ':@react-native-community_async-storage'.

I want to:

Do a build for android
Details:

So I'm having an error when doing a build:

A problem occurred configuring project ':@react-native-community_async-storage'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

subprojects {
    afterEvaluate { project ->
        android {
            compileSdkVersion 28
            buildToolsVersion "28.0.3"
        }
    }
}

settings.gradle
rootProject.name = 'armadillo'
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')

include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')

include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')

include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')

include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')

include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')

include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')

include ':app'

local.properties
sdk.dir = /Users/{myUserName}/Library/Android/sdk

Versions:
"@react-native-community/async-storage": "^1.6.1",
"react": "^16.8.3",
"react-native": "^0.59.0",

I got the same issue in
"react": "^16.8.3",
"react-native": "^0.60.5"

@swoppy npx jetify gives:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/jetify - Not found
npm ERR! 404
npm ERR! 404  'jetify@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alexchin/.npm/_logs/2019-09-19T00_58_57_758Z-debug.log
Install for [ 'jetify@latest' ] failed with code 1

yea, it appears that you do not have jetify installed. So you may wanna put that in your modules first.

yea, it appears that you do not have jetify installed. So you may wanna put that in your modules first.

yep, to do it use npm i jetifier

In my Case I used :
sdk.dir = C:\Users\Lenovo\AppData\Local\Android\sdk
in local.properties file .
#Note:
If you are using your phone as emulator, keep in plugged with the USB Debugging mode ON.
This is how i solved .

In my Case I used :
sdk.dir = C:\Users\Lenovo\AppData\Local\Android\sdk
in local.properties file .
#Note:
If you are using your phone as emulator, keep in plugged with the USB Debugging mode ON.
This is how i solved .

Please, where did u exactly put it?

source: gharchive/issue

authors: LucasKeiti28 alexpchin menarayanzshrestha pedromelo98 sriram-cg-xelp swoppy

repo: react-native-community/async-storage


text:
Snapshot test fails on typescript

Environment
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Memory: 1.55 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.2 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Platforms
both
Versions

react-native-netinfo: 3.2.1
react-native: 0.59.9
react: 16.8.3

Description
I've got such error when I ran test:
TypeError: Cannot read property 'then' of undefined
  61 |
  62 |   componentDidMount() {
> 63 |     NetInfo.fetch().then((state) => {
     |     ^
  64 |       this.setState({ isConnected: state.isConnected });
  65 |     });
  66 |     this.unsubscribe = NetInfo.addEventListener(state => {

  at ErrorWithActionsComponent.componentDidMount (src/app/common/components/Error.tsx:63:5)
  at commitLifeCycles (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9253:22)
  at commitAllLifeCycles (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10650:7)
  at Object.invokeGuardedCallbackImpl (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2299:10)
  at invokeGuardedCallback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2477:31)
  at commitRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10862:7)
  at node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12313:5
  at Object.unstable_runWithPriority (node_modules/scheduler/cjs/scheduler.development.js:255:12)
  at completeRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12312:13)
  at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12241:9)

Resolve
You should add the following to your Jest setup file to mock the NetInfo Native Module
import { NativeModules } from 'react-native';
NativeModules.RNCNetInfo = {
getCurrentState: jest.fn(() => Promise.resolve(true)),
addListener: jest.fn(),
removeListeners: jest.fn(),
};


text:
flow-bin errors

Steps to reproduce
1.Install react-native 0.61.2
2. Install flow-bin 0.105.1 (which is the version that matches with react-native 0.61.2)
3. Install react-native-share 2.0.0 and use it in a js file
4. Run node_modules/.bin/flow
Expected behaviour
It to report No errors!
Actual behaviour
It reports these issues:
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/react-native-share/components/Button.js:38:40

Cannot create Image element because string [1] is incompatible with number [2] in property source.

     node_modules/react-native-share/components/Button.js
     35│
 [1] 36│ export default ({ buttonStyle, onPress, iconSrc, textStyle, children }: Props) => (
     37│   <TouchableOpacity activeOpacity={0.5} style={[styles.button, buttonStyle]} onPress={onPress}>
     38│     <Image style={styles.icon} source={iconSrc} />
     39│     <Text style={[styles.buttonText, textStyle]}>{children}</Text>
     40│   </TouchableOpacity>
     41│ );

     node_modules/react-native/Libraries/Image/ImageSource.js
 [2] 90│ export type ImageSource = ImageURISource | number | Array<ImageURISource>;

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/react-native-share/components/Overlay.js:51:49

Cannot call Animated.timing with object literal bound to config because property useNativeDriver is missing in object
literal [1] but exists in AnimationConfig [2].

     node_modules/react-native-share/components/Overlay.js
     48│     if (newProps.visible) {
     49│       this.setState({ overlayStyle: styles.fullOverlay });
     50│     }
 [1] 51│     return Animated.timing(this.state.fadeAnim, {
     52│       toValue: newProps.visible ? 1 : 0,
     53│       duration: DEFAULT_ANIMATE_TIME,
     54│     }).start(this.onAnimatedEnd.bind(this));
     55│   }
     56│   render() {
     57│     return (

     node_modules/react-native/Libraries/Animated/src/animations/TimingAnimation.js
 [2] 20│ export type TimingAnimationConfig = AnimationConfig & {

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/react-native-share/components/Sheet.js:24:47

Cannot call Animated.timing with object literal bound to config because property useNativeDriver is missing in object
literal [1] but exists in AnimationConfig [2].

     node_modules/react-native-share/components/Sheet.js
     21│   };
     22│
     23│   UNSAFE_componentWillReceiveProps(newProps: Props) {
 [1] 24│     return Animated.timing(this.state.bottom, {
     25│       toValue: newProps.visible ? 0 : DEFAULT_BOTTOM,
     26│       duration: DEFAULT_ANIMATE_TIME,
     27│     }).start();
     28│   }
     29│
     30│   render() {

     node_modules/react-native/Libraries/Animated/src/animations/TimingAnimation.js
 [2] 20│ export type TimingAnimationConfig = AnimationConfig & {

Found 3 errors

Environment

React Native version: 0.61.2
React Native platform + platform version: Android 5.0

react-native-share
Version: 2.0.0

@sassanh thanks.
We're accepting pull requests to fix flow errors.

Hi @sassanh, I had the same issue in our project upgrading RN 0.60.5 -> 0.61.5 with flow-bin 0.98.0 -> 0.105.0.
My issue was related to the image import using haste module:
import mySource from '@module/image.png'
The '@' isn't recognised in the .flowconfig file, so I had to modify it like this:
-module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
+module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

@jgcmarins I don't know if it's the right way to fix the issue, can you confirm it's Ok to proceed like this ? I don't personnaly use react-native-share but I'll be glad to make a pull request if needed.

@aamalric flow can probably be wrong

authors: aamalric jgcmarins sassanh


text:
Can't get the actual path of image where it is stored in my internal storage[🌟]

Description
Explain the feature request in as much detail as possible.
Proposed Solution
What needs to be done to make it happen?
Test Solution
How would we test & validate the feature?

I also found this issue during my Android App development.
Currently, the library seems to create a new (resized) image from the selected image.
It might be nice if there is a way to access the image through fileURI, not contentURI.
https://github.com/react-native-image-picker/react-native-image-picker/blob/4bba2470452cd91a16e53049ab8c965b111acbb6/android/src/main/java/com/imagepicker/ImagePickerModule.java#L133-L134

I also found this issue during my Android App development.
Currently, the library seems to create a new (resized) image from the selected image.
It might be nice if there is a way to access the image through fileURI, not contentURI.
https://github.com/react-native-image-picker/react-native-image-picker/blob/4bba2470452cd91a16e53049ab8c965b111acbb6/android/src/main/java/com/imagepicker/ImagePickerModule.java#L133-L134

@sameerahmed56 what is the problem in using the returned uri on android and ios? Elaborate on the problem you'r facing.

@sameerahmed56 what is the problem in using the returned uri on android and ios? Elaborate on the problem you'r facing.

this came into crashlytics today:
Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=13002, result=-1, data=Intent { dat=content://com.google.android.apps.photos.contentprovider/-1/1/content://media/external/images/media/963/ORIGINAL/NONE/image/jpeg/1882044403 flg=0x1 clip={text/uri-list U:content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F963/ORIGINAL/NONE/image%2Fjpeg/1882044403} }} to activity {com.XXX/com.XXXX.MainActivity}: java.lang.NullPointerException: uri
       at android.app.ActivityThread.deliverResults(ActivityThread.java:4544)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:4586)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1864)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:205)
       at android.app.ActivityThread.main(ActivityThread.java:6991)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:884)

i'm using 3.2.1

Hi, I am having this problem as well. I feel like making another issue is pointless. My issue is that the tesseract library (https://github.com/jonathanpalma/react-native-tesseract-ocr) I am using to do OCR cannot handle the in app path, I get a file not found exception, when passing in the path to internal storage manually the issue is resolved and the library works.

Now latest version provides file uri to images. I hope the issue is solved, if not reply here or create new issue with details I am happy to fix it.


text:
react-native-maps:processReleaseResources FAILED

Hello friends!
I'm using react native 0.45 and airbnb/react-native-maps for use MapView component in a physical devices (i have installed google play services) with android version 4.4, but i have the following problem:
`:react-native-maps:processReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-maps:processReleaseResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
Total time: 1 mins 23.55 secs
`
help me please
AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mapas"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="22" />

    <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

      <meta-data
      android:name="com.google.android.geo.API_KEY"
      android:value="AIzaSyBd_zSqROI3PO8tJTsqHFbReB-WihofHvg"/>
    </application>

</manifest>

MainAplication.java

package com.mapas;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import com.airbnb.android.react.maps.MapsPackage;
import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new MapsPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

BUILD.GRADLE :

apply plugin: "com.android.application"

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation
 *   entryFile: "index.android.js",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

apply from: "../../node_modules/react-native/react.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.mapas"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile project(':react-native-maps')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

Everything looks legit. So try the following

cd android && ./gradlew clean
./gradlew assembleDebug --stacktrace

This will spit out the error in verbose terms. for example Cannot run program "/home/user/Android/Sdk/build-tools/25.0.3/aapt" (in directory "/home/user/sampleProject/node_modules/react-native-maps/lib/android"): error=13, Permission denied
Notice the build-tool being used. Go to the folder, right click and click on properties then permissions. At the bottom you will find change permissions for enclosed files, when the dialog comes up click on change.
Next find the aapt file inside the folder, go to permissions and enable it to be executed.  That is about it.
Repeat the steps above and voila!!!!!!!!!!! You will be good to go !!!!!!!!

OK, change permissions for AAPT build tool

@Ernoff  a good solution it worked for me

cd android
./gradlew clean
./gradlew assembleDebug --stacktrace
4 ./gradlew clean

thanks alot, this one worked for me

But I want Release build
I know Its work fine with the ./gradlew assembleDebug --stacktrace but I need assembleRelease Plz help
I have tried with below cmds

./gradlew clean
./gradlew assembleRelease
But no luck :(

I have the same issue. Any solution?

@ghasemikasra39  Have you tried the above suggested solutions?

Dear @Ernoff
I tested the above solution, working perfectly

It worked

It worked

authors: Ernoff bethwelt fahad39 ghasemikasra39 gjae jurby narugirase okumujustine

repo: react-native-maps/react-native-maps


text:
Warning: Failed prop type: The prop coordinate is marked as required in MapMarker, but its value is null.

react-native-maps, it's working fine but when I remove PROVIDER_GOOGLE it gave me this error, The error is located somewhere is Callout without Callout component it works fine with apple maps but when I add this it gave me this Warning: Failed prop type: The prop coordinate is marked as required in MapMarker, but its value is null.
<Callout onPress={() => showModalChargeInfo()} tooltip>
<View style={{
height: 70,
width: 250,
flexDirection: 'row',
marginBottom:10,
...styles.shadow,
}}>
Banner

Does anyone have a solution?

Hi @muhammadqazi. I'm gonna have to ask you to take the time it takes to fill out the issue template. There's not nearly enough information in the issue to provided, to sort out if this is a bug. Please feel free to open a new issue following the issue template, and make sure to take a look at how to provide minimal reproducible example :)

Aight, I'm gonna follow it in the next issue.

authors: Simon-TechForm muhammadqazi


text:
Relative links in href are empty when loading a local HTML file on Android

I am downloading a .html file using react-native-fs and then reading it using the same library, then I set the read HTML string as a source={html: readfile}. The pages render fine on both platforms, but with one exception. The relative links ("/page/subpage") are not working, which is expected since for a local file the root URL is always "file://". I tried fixing it by injecting a JS script onLoad (the script looks for <a/> tags and if the first letter of its href is "/" it adds "www.somesite.com" at the beginning). This solution works perfect on IOS, but not on android. For some reason on android all hrefs with relative links are empty.  (hrefs with absolute links are working fine).
Ps. When I console.log the .html file, all of the hrefs are there, so it is not a problem with downloading nor reading the file.

To Reproduce:
-> Download a page using react-native-fs (or any other library, I don't think it matters)
-> Read the file
-> Set the read file as a source={html: myfile} in webview
-> The relative URLs are gone on Android, while still being present on IOS

Expected behavior:
->The URLs should behave the same on both platforms

Environment:

OS: Android
OS version: 28
react-native version: 0.62
react-native-webview version: 10.3.3

I found a solution. Instead of reading the file and then passing it as a source={{html: myFileAsString}} i just pass the path to the file: source={{uri: "file://" + myPathToFile}}. Thanks to that modification i was able to solve my issue.

I found a solution. Instead of reading the file and then passing it as a source={{html: myFileAsString}} i just pass the path to the file: source={{uri: "file://" + myPathToFile}}. Thanks to that modification i was able to solve my issue.

I tried this method, but failed：https://github.com/react-native-webview/react-native-webview/issues/1560#issuecomment-765145276

I found a solution. Instead of reading the file and then passing it as a source={{html: myFileAsString}} i just pass the path to the file: source={{uri: "file://" + myPathToFile}}. Thanks to that modification i was able to solve my issue.

I tried this method, but failed：https://github.com/react-native-webview/react-native-webview/issues/1560#issuecomment-765145276

authors: DominikHinc mofengfs


text:
Update preventing-going-back.md

I found an issue that in some cases the same listener may be added repetitively causing multiple alerts. To fix that, perform a removeListener() before addListener().

Why would there be an extra listener added automatically that you need to remove? Also you're passing an anonymous function to removeListener, so how would it know which listener to remove?
Also you need to actually return the value of addListener so that event can be cleaned up.


text:
config and server/config might be confusing

After centralizing config #792 , there is still a config folder in server directory.
I think we can simplify that by making folder structure like below.
--server(folder)
----db(folder)
----passportStrategy(folder)
------local.js
------google.js
----express.js
----passport.js
----routes.js
----index.js

or maybe just changing config folder name into another.

This makes a lot of sense. I remember being confused by this when first using this project. especially since a lot of the code in that folder is not config, but express middleware / routes, db models etc.

@GGAlanSmithee @choonkending I think just renaming folder is better.
--server(folder)
----index.js
----db(folder)
----???(folder, previously config)

I have bad naming skills, especially in english. So can you guys rename it?

You peeps are the best!
When I did https://github.com/reactGo/reactGo/pull/792#issue-198292090 I decided to keep the remaining server/config files out because I couldn't decide whether or not to move them out or rename it.

especially since a lot of the code in that folder is not config, but express middleware / routes, db models etc

Exactly!
What is an intention-revealing name for a folder? I agree with @ZeroCho that renaming the folder would make sense.
I was thinking:

bootstrap
init

Any other ideas? This was my next PR planned for clean up, but I still haven't decided which name to use.

IMO, it would be enough to remove the config folder, moving it's content one level up. (and moving /renaming passport.js to passport/index.js

@GGAlanSmithee That's what I initially attempted as well.
When I moved the content one level up, the file names became a bit too generic to my liking. I then renamed them to loadPassport, loadRoutes, loadExpress to indicate that they were methods that we called to bootstrap our application.
server/
   - /db
   - index.js
   - loadPassport.js
   - loadRoutes.js
   - loadExpress.js

Given that they are all used for loading/bootstrapping/initialising our application, it then made sense to just rename config to indicate what those files were actually used for (which is what @ZeroCho mentioned).
For now, I'll rename the folder to init and make passport.js into passport/index.js. If we find that it's confusing still, we can revisit this issue in the future.
Thanks for all the suggestions!

authors: GGAlanSmithee ZeroCho choonkending

repo: reactGo/reactGo

license: mit

license_source: bigquery


text:
Uncaught Error: Cannot find module '../dist/bundle.js'

I get this error when running the project

Hey,
You need two command for starting reactide correctly, once run npm run dev command and wait for webpack to start, then run npm run dev-start in another command line tab.

This should be added to the README!
I expected npm start to work

authors: atakangktepe capaj ncphillips

repo: reactide/reactide


text:
CSS Modules

Current Situation
Currently, there is no way to tie CSS to an individual component, such as React CSS Modules
Here's some samples on how this works in React

https://css-tricks.com/different-ways-to-write-css-in-react/#aa-use-css-modules
https://css-tricks.com/css-modules-part-1-need/

See previous issue #671
Proposed Actions
This should be possible by

Parse a CSS file into selectors and style pairs such as {'#my-selector': {  ... } }. We can do this via...

Writing some CSS parsing regex
tinycss2
cssutils
cssjson

Parsing the component's VDOM into an LXML node tree using our vdom_to_etree util function
Determining where to apply styles via cssslect
Convert the etree back into VDOM using etree_to_vdom.

Note: With the interfaces below, we might want to implement a cache_handler = ... parameter to allow for customization on how we store stylesheet in cache.
Inline Style Interface
The user interface may look something like this
@component
@css_module("/path/to/stylesheet.css") # Allow for string paths or a file handle
def my_component( ... ):
   return html.div({"className": "styles.my_selector"}, ... )

However, this kind of interface does not retain the same kind of dot notation that React CSS Modules support. If going with this implementation, we would be forced to apply all styling using in-line styles.
In-line styles are not necessarily an issue, but would severely increase size DOM in situations where one selector can apply to 100+ elements.
CSS Modules Imitation Interface
To more accurately imitate React, we might want to consider this interface instead.
styles = css_module("/path/to/stylesheet.css")  # Allow for string paths or a file handle

@component
@styles  # This decorator should only exist for options 1, 4, and 5 seen below. It exists to modify the VDOM to add a stylesheet.
def my_component( ... ):
   return html.div({"className": styles.my_selector }, ... )

The appended stylesheet will have its selectors converted to be unique {filename}_{classname}_{hash}, and all values referenced by the dot notation (eg styles.my_selector) will use these unique selectors. The hash value should be based on the component's dotted path.
In this example, the uniquely generated selector may look something like styles_my_selector_309571057.
What to do with the stylesheet?
Generally, React CSS modules are precompiled (webpack-esque) and stored in some output directory, then it is left up the the webserver to serve them.
Since we currently have no way of pre-compiling CSS modules, we have a few options

Serve the file's contents as a string within a html.style tag

This is the simplest solution, but would lead to duplicated style rules for each time the component is rendered on the page

Force the user to display a component that renders all CSS modules in one stylesheet

Would require creating a load/unload framework for CSS Modules

Force the user to display a component that renders one CSS module in a stylesheet

Gives the user more control over rending behavior
The __call__ on styles (as seen above) could potentially be used as a ComponentConstructor rather than a decorator

Create a Python view that is effectively a primitive static file server

This could prove useful for future JavaScript module capabilities

Compile CSS on-the-fly into an output directory and have the user serve this files themselves

Is less convenient than the methods above
Would not have compatibility with whitenoise

I currently think CSS Modules Imitation Interface and Option 3 is the best bet.
I'll likely develop this next month, so let me know if you disagree.

I've another thing not like the options you've said.
in my framework I use different mechanism could work for you guys, I make a CSS_UTILS object that knows the CSS writting rules and pre process them, so whatever goes in it get out as normal css code.
and a CSS_WORKER object that handle the CSS of the elements, every element has it's own styling written with it, it's more like write a css file for each element, but in deffernt way.
so when a component made I made the programmer decide is it a server-side redered or a client-side rendered, and by the dececion that is made, I made the WORKER to handle the css styling is it need to be in a css file or not.
in the case of not -- which means a client-side render -- the WORKER pass the styling to a JS_WORKER, which makes the styling been written and made with javascript, in that case any adding to the css is made in the stylesheer-inspector (in another hand in the browser it self).
you can get inspired from the mechanism and it may help you, since I see that there is some JS integrations already in your project.
cheers.

authors: Archmonger OsamaElsherif

repo: reactive-python/reactpy


text:
TCK: make §3.9 tests optional

This PR changes the TCK check for rule §3.9

While the Subscription is not cancelled, Subscription.request(long n) MUST signal onError with a java.lang.IllegalArgumentException if the argument is <= 0. The cause message MUST include a reference to this rule and/or quote the full rule.

to be optional (related discussion).
Rationale: libraries may report such kind of request accounting bugs by other means instead of the very expensive synchronization required by §1.3 to ensure correct error reporting by §3.9 of which clients can't do much about anyway.

The spec would also need to be amended to make the behavior optional.

The spec would also need to be amended to make the behavior optional.

You are currently editing the spec in #339 which would conflict.

@reactive-streams/contributors add approved review and we'll merge 👍

After the discussion and the resulting changes done to the libraries, this change is now mute.

@akarnokd To refresh my memory (and any other reader) what was the conclusion? (link will do just fine for me)

The specification for §3.9 stays as a MUST and thus the associated TCK test MUST be passed.

@akarnokd thanks!

authors: akarnokd smaldini viktorklang

repo: reactive-streams/reactive-streams-jvm


text:
Where does init_script.sh log to?

I have added this to my Kubegres CRD (in spec.customConfig) to override the init_script.sh . I'd like to know if it's working. If I echo in the overridden script, where can I find the output? I tried looking at the pods' logs, and the CRD Kubegres doesn't have logs:
apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
  name: mypostgres
  namespace: default
spec:
   replicas: 3
   image: postgres:13.2
   database:
      size: 200Mi
   customConfig: mypostgres-conf

   env:
      - name: POSTGRES_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: superUserPassword

      - name: POSTGRES_REPLICATION_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: replicationUserPassword

In the ConfigMap mypostgres-conf.yaml:
apiVersion: v1
kind: ConfigMap
metadata:
  name: mypostgres-conf
  namespace: default
data:
  primary_init_script.sh: |
    #!/bin/bash
    set -e

    # This script assumes that the env-var $POSTGRES_MY_DB_PASSWORD contains the password of the custom user to create.
    # You can add any env-var in your Kubegres resource config YAML.

    dt=$(date '+%d/%m/%Y %H:%M:%S');
    echo "$dt - Running init script the 1st time Primary PostgreSql container is created...";

    # customDatabaseName="my_app_db"
    # customUserName="my_username"

    # echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ...";

    # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
    # CREATE DATABASE $customDatabaseName;
    # CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MY_DB_PASSWORD';
    # GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName;
    # EOSQL

    # echo "$dt - Init script is completed";

Thanks for your response.
I don't see that the script was ever run. I started up everything from scratch, and query the logs of the primary postgres pod:
$ kubectl logs mypostgres-1-0 | grep 'Running init script'
$

I would expect to see "Running init script the 1st time Primary PostgreSql container is created" given the echo statement in the script in the configmap above...

I copied past the "kind: ConfigMap" and "kind: Kubegres" that you have provided and it worked for me. In the Primary Pod's logs I can see:
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/primary_init_script.sh
15/09/2021 08:05:25 - Running init script the 1st time Primary PostgreSql container is created...

And looking in the logs that you have provided, it looks like your custom configMap is not used by Primary Pod.
In which order did you create the resources?
For me it was:

create my custom configmap
create secret
create kubegres yaml

Hmm, still not working for me. Again, here's kubegres manifest:
apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
  name: mypostgres
  namespace: default

spec:

   replicas: 3
   image: postgres:13.2

   database:
      size: 200Mi
   customConfig: mypostgres-conf
   env:
      - name: POSTGRES_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: superUserPassword

      - name: POSTGRES_REPLICATION_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: replicationUserPassword

conf manifest:
apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
  name: mypostgres
  namespace: default

spec:

   replicas: 3
   image: postgres:13.2

   database:
      size: 200Mi
   customConfig: mypostgres-conf
   env:
      - name: POSTGRES_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: superUserPassword

      - name: POSTGRES_REPLICATION_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: replicationUserPassword

Order of manifest creation (I am using skaffold):
...
 - configmap/web-configmap created
 - deployment.apps/web-deployment created
 - service/web-service created
 - cronjob.batch/print-hello created
 - configmap/mypostgres-conf created
 - secret/mypostgres-secret created
 - kubegres.kubegres.reactive-tech.io/mypostgres created
 ...

I terminate all pods by doing skaffold delete and confirm they don't exist. Then:
$ kubectl logs mypostgres-1-0

PostgreSQL Database directory appears to contain a database; Skipping initialization

2021-09-15 10:04:18.701 GMT [1] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-09-15 10:04:18.701 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-09-15 10:04:18.701 GMT [1] LOG:  listening on IPv6 address "::", port 5432
2021-09-15 10:04:18.702 GMT [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-09-15 10:04:18.705 GMT [26] LOG:  database system was shut down at 2021-09-15 10:04:11 GMT
2021-09-15 10:04:18.709 GMT [1] LOG:  database system is ready to accept connections

Could you please retry by deleting the PVC which were assigned to "mypostgres-1-0"?
The following message means a database already exists as it reuse the DB in the previously created PVC:
"PostgreSQL Database directory appears to contain a database; Skipping initialization"

That was it! Thanks!

I am glad the root cause was identified.
I am closing this issue.

authors: alex-arica kahunacohen

repo: reactive-tech/kubegres


text:
Having issue with using an array as query arguments on prepared statements

I've seen other issues with sending arrays as query params, but they are all closed and the problem still looks like it's there.
my query takes in an array of strings and then fails with the message

[[Ljava.lang.String;@141c4c78] cannot be coerced to [String]

create table notes
(
  id        char(36)      not null
    constraint notes_pk
      primary key,
  rich_text varchar(2000) not null
);

SELECT * FROM notes WHERE id IN ($1);
val args = noteIds.toTypedArray().let {
    Tuple.tuple().addStringArray(it)
}

pool.preparedQuery(query, args) { rowsAsync ->
    // other code
}

I tried changing everything to the uuid type rathing than holding it in a char(36), but i got the same result
[[Ljava.util.UUID;@394972bf] cannot be coerced to [UUID]

@huntj88 this is because the type of $1 is String and is not String[], this is actually a postgres issue and not an issue of this client

I think somebody raise a similar issue in this tracker

you nee to change your query to select 1 where 1 = any ($1), see this issue https://github.com/reactiverse/reactive-pg-client/issues/169#issuecomment-418385715

repo: reactiverse/reactive-pg-client


text:
Accept null value for json parameter

A JSON column can be nullable, so a null value must be accepted

we need a test for this

I added the test for all types, so i fixed for enum too.

@vietj is the test good enough?

it looks great! thanks for the contribution!

@vietj just for my information, have you planned a release in days/weeks comming ?

I think it's can be easily done over the week end

the base version will be 3.6, however it will be tested for 3.6 and 3.5.4

Cool

authors: vietj ybonnel


text:
Get the console shim to actually do something useful

We've found on a few occasions points where a little console statement would have made debugging so much easier.
Currently for server-side rendering a shim is included for console. I'm pondering two possible solutions that could be handy here. One is to allow the console statement to write to log4net or similar the other is to have the console statement append to an array and then if in debug mod (flagged somehow TBC) it spits the results out in page in a div at the end or as a client-side call to console.log( myinternallogger ); which would allow us to see the output in the browsers dev tools.
Thoughts?

Serious +1 on this! I have a somewhat decent workflow going, but every once in awhile, I run into an issue where the server-side rendering blows up and I am forced to pour over my code to try and figure out what is wrong. I was actually going to post an issue here to ask if I was doing it wrong.
I would be ok with either method, but I think having it spit the log messages out into a div would be easiest for most people to utilize.

The issue with calling back into .NET code is that there's no cross-engine way of doing it. ClearScript and VroomJs have different ways of doing it, but I don't think the MSIE engine supports it. I wonder if it could be added to JavaScriptEngineSwitcher. Alternatively I could just move to only supporting V8.
I love the idea of converting them to client-side console calls though! That should definitely be doable. The shim could cache all the calls and then just render them out when scripts are rendered. I'll work on this for the next release.

Implemented a basic version in eff1c2b134ac47771c6991d180cb7908ffffd6d1. This will catch all the console calls made server-side and output them as part of the JS init code (@Html.ReactInitJavaScript() in ASP.NET MVC). I can add a separate method that gets just the log calls if there's a valid use case for that :)

authors: Daniel15 PeteDuncanson jslatts


text:
Changelog generation may be broken again?

It looks like there is something up with the changelog again, as it was "updated" in the 3.0 release but only shows a duplicate v2.4.1 instead of having a proper v3.0.0 section.  Did the fix back in September somehow not make it into the next branch?

Jumping on the topic as well. Can we easily update to this new version? Are there breaking changes? I could not find any change logs from migrating to v3.0.0?

@quachsimon No, there are no breaking changes. The major version bump was just to make where the support for React 16 is available.
@dlong500 I'll fix the changelog, I don't know yet if it's a bug or regression.

The issue is sometimes I release a version on the machine (home or at office) and the repository has some missing tags. This confuses the changelog generator.
I'll be more careful on the next releases.

CHANGELOG was updated. Thanks!

Is it possible this may have happened again? d6931d13 added a section for 3.4.4, but the section contains a single empty bullet point.

authors: diasbruno dlong500 quachsimon rimunroe

repo: reactjs/react-modal


text:
[Beta] Upgrade to MDX 2

MDX 2 has vastly better error messages because it uses AST instead of string manipulation.
It also has fewer confusing syntax pitfalls.
I don't expect any perf improvement because we were already skipping MDX runtime in favor of lean output.
Supersedes https://github.com/reactjs/reactjs.org/pull/4058 and https://github.com/reactjs/reactjs.org/pull/4081.
This was relatively easy to upgrade thanks to the work in https://github.com/reactjs/reactjs.org/pull/4105, https://github.com/reactjs/reactjs.org/pull/4990 and https://github.com/reactjs/reactjs.org/pull/4991.

Awesome!

authors: gaearon wooorm


text:
Error handling while updating store

I want to report a question-bug?
So, redux make an update in try block, but doesn't handle an error in catch. Is there any reason don't do this?
How could I debug these errors on prod without redux-logger of course?
What is the current behavior?
Error in reducer while updating state doesn't throw.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
https://github.com/reactjs/redux/blob/master/src/createStore.js#L168-L173
Production build - clean console

Development build - I see an error only with redux-logger

Development build (without redux-logger) - I don't see an error

Development build (without redux-logger but mentioned lines were changed)
try {
  isDispatching = true;
  currentState = currentReducer(currentState, action);
} catch(e) {
  console.error(e)
} finally {
  isDispatching = false;
}

What is the expected behavior?
Error message about an error
Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?
Redux: 3.7.2
Browser: Chrome
OS: macOS
Did this work in previous versions of Redux?
Maybe

We don't want to catch so that you can handle the error however you would like to. We only want to ensure our local state variable (isDispatching) is reset back to the correct value, which we use finally for. You can implement error handling in a middleware, if you want.

authors: isnifer timdorr

repo: reactjs/redux


text:
Update typescript.md

感谢

authors: idealx sunnylqm

repo: reactnativecn/react-native-website


text:
How to connect styleguidist?

Babelified webpack configs (like webpack.config.babel.js) are not supported. We recommend to convert your config to native Node — Node 6 supports many ES6 features.

ReactQL uses very a opinionated Webpack config, so I’m not sure how likely it will be getting it to work with third-party tooling that had its own Webpack flow. React Storybook was also a problem.

repo: reactql/cli


text:
popup modal dialog: escape should behave the same as clicking the cross => close and return focus to calling site

To reproduce: try with the "delete book" dialog.

Related issue: https://github.com/readium/readium-desktop/issues/304

Let's close this issue, in favour of this better-described one:
https://github.com/readium/readium-desktop/issues/455

repo: readium/readium-desktop


text:
Text search over entire book

We use jQuery to search through a book. In previous Readium versions, with eager loading enabled, we were able to search through the entire book. But eager loading has been removed.
We would prefer a Readium native way to search through the entire book. This could use the same approach as Total Page Numbers Issue #16 with a second hidden readium and iterating over that.

Good work being done here:
https://github.com/GermanCentralLibraryForTheBlind/readium-js-viewer/commits/feature/full_text_search

https://github.com/fergiemcdowall/forage
How to use above to read Epub book. How to integrate this along with https://github.com/GermanCentralLibraryForTheBlind/readium-js-viewer/commits/feature/full_text_search

How to implement text search over entire book?

@naveen1941 you can experiment with this Node-based search engine:
https://github.com/larsvoigt/epub-full-text-search

I will post when the mentioned search engine can be run and tested. I think, this will be in the near future :-).

Thanks you team. ☺☺
On Mon, Jul 13, 2015 at 5:57 PM, Lars Voigt notifications@github.com
wrote:

I will post when the mentioned search engine can be run and tested. I
think, this will be in the near future :-).
—
Reply to this email directly or view it on GitHub
https://github.com/readium/readium-js/issues/17#issuecomment-120909357.

--
*Regards,*Naveen Kumar

@larsvoigt : Thanks!  Much appreciated

Hi all,
I think I have reached a pre-alpha state of the full-text-search-feature.
Status informations following:
Note:

Full-Text-Search-Feature works only in Webkit based browsers without limits
The current  feature only supports the cloud-reader version (maybe for browser version in future to come)

Running demo
A running demo can be found here: http://fulltextsearch-readium.rhcloud.com/.
It combines epub-full-text-search and readium-js-viewer.
Source of demo
The source code of the demo can be found here: Source Code
For testing call:

git clone https://github.com/larsvoigt/readium-full-text-search-demo.git
npm install
npm run start

Note: The indexing process starts automatically and it takes a few seconds until the search service is really available. Availability is indicated by cli status "all is indexed".
epub-full-text-search usage
If you want see how this feature can be implemented then check out [branch] (https://github.com/larsvoigt/readium-js-viewer/tree/feature/new_full_text_search).
To get it run call:

Prerequisites are same like the orginal readium repro
npm run build
npm run dist:cloudReaderWithFullTextSearch

Feature main components:

Client-Side-Implementation: FullTextSearch.js
Server-Side-Service: Server.js

Thank you for your feedback :-)

@larsvoigt great thanks!
I tried searching for "reilly" in the "accessible EPUB3" ebook hosted at http://fulltextsearch-readium.rhcloud.com
=> when pressing the next / previous buttons, the highlighted fragments of text (search "hits") are sometimes incorrect. Can you reproduce this bug?
Speaking of highlights...I assume you are using the built-in "annotations" plugin, which utilises a div overlay method to render the selection? This plugin is now deactivated in the develop branch, and it is likely to be removed entirely due to memory bugs / obsolescence (CC @JCCR):
https://github.com/readium/readium-shared-js/issues/201
Once the existing CFI bugs have been ironed out, and the architecture improved, it will be a good time to re-instate a more robust version of the highlighting mechanism.

Thank @danielweck for your feedback. I will fix this bug as soon as possible.
Indeed I use the built-in "annotations" plugin. Upps I am not up-to-date. Do you mean, that highlighting is impossible by using the latest developing branch?

As of right now, the develop branch still contains the "annotations" plugin, it is just deactivated. See https://github.com/readium/readium-shared-js/blob/develop/plugins/plugins.cson
You can re-activate it in your custom readium-shared-js/plugins/plugins-override.cson, but the plan is indeed to extract the plugin into a feature branch, so that it does not interfere with future core CFI bug fixes / architecture improvements.

Thank you for sharing this information. At the moment I will use the re-activate option to support highligting. This way I will keep synchronized with the latest developing.

@larsvoigt , note that Juan Corona @JCCR has started work on refactoring the old "annotations" plugin (which was really more about "highlighting" document ranges than a full-blown annotations engine).
See:
https://github.com/readium/readium-js-viewer/pull/403
https://github.com/readium/readium-shared-js/pull/212
This is an architecturally-improved version of the old annotations plugin, with some fixes too.

Thanks @danielweck for this hint. Great job @JCCR! Unfortunately I can't test it today.
But next week I will have a look on it.

What is the status of this? This would be highly useful :)

Have you tried @larsvoigt 's open-source server-side indexer / search service?
https://github.com/larsvoigt/epub-full-text-search
http://protected-dusk-3051.herokuapp.com/?searchbox=popu

Dear Lars,
I have tried to integrate full-text-search in my Readium cloud reader, by flowing the instructions you shared in the above mentioned comments:
"epub-full-text-search usage
If you want see how this feature can be implemented then check out branch.
To get it run call:
Prerequisites are same like the orginal readium repro
npm run build
npm run dist:cloudReaderWithFullTextSearch"
But I cannot integrate it in my Cloud reader that locally works on my computer. When I use "npm run dist:cloudReaderWithFullTextSearch", my build-output folder is empty. Also the dist folder does not consist of all required folders and files.
Could you please let me know if I need to take into account specific points.
Thanks in advance,
Hajar

authors: brezal danielweck hajarghaem larsvoigt naveen1941 pivotal-versapub rkwright

repo: readium/readium-js


text:
Method implementation is displayed for one line method declaration in Swift API References

https://realm.io/docs/swift/0.103.2/api/Classes/LinkingObjects.html#/s:vC10RealmSwift14LinkingObjects11invalidatedSb
It might be addressed to Jazzy or to "coding guidelines".

I think this has something to do with SourceKitten. I saw the same thing when dumping the public APIs for Realm Swift yesterday.

Yes, this is due to SourceKit not having enough information to detect where the declaration ends and the body begins.

We're also tracking this in jazzy: realm/jazzy#226

fixed.

authors: austinzheng jpsim stel

repo: realm/realm-cocoa


text:
Memory Leak?

Hi,
Just checking my application with instruments and I see some memory leaks from realm:

Version of Realm and Tooling
In the CONTRIBUTING guidelines, you will find a script,
which will help determining these versions.
Realm version:  Lastest
Xcode version: 7.3.1
iOS/OSX version: 9.3

Thanks for the report, @josete89. We're tracking this issue in #2933. Our best understanding is that this is a bug in the Swift runtime, rather than in Realm itself.


text:
EXC_BAD_ACCESS (SIGSEGV) issue on watch

On Watch devices, users are facing with crash issues sometimes.
WatchOS version: 7.1 and up (haven't seen any of below OS 7.1)
Affected devices: Watch series 3
Used Realm versions: v10.7.4
I'm sharing crash report and function called fetchFromRealm with you.
Crash report;
Date/Time:           2021-05-05 12:35:35.1360 +0430
Launch Time:         2021-05-05 12:35:32.0000 +0430
OS Version:          Watch OS 7.3.3 (18S830)
Release Type:        User
Baseband Version:    n/a

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xfffffffc
VM Region Info: 0xfffffffc is not in any region.  Bytes after previous region: 2286731261
      REGION TYPE                START - END     [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      unused shlib __TEXT      772f0000-77b34000 [ 8464K] r--/r-- SM=COW  ... this process
--->
      UNUSED SPACE AT END

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [545]
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   ...pp - MY APPLICATION	0x00523f98 specialized MYStaticClass.fetchFromRealm<A>(key:value:) + 40 (MYStaticClass.swift:0)
1   ...pp - MY APPLICATION	0x004e4e42 fetchFromRealm + 12 (MYStaticClass.swift:0)
2   ...pp - MY APPLICATION	0x004e4e42 MYStaticClass.init() + 2082 (MYStaticClass.swift:44)
3   ...pp - MY APPLICATION	0x004e435e globalinit_33_A07D3C17314E5551FE6EB93979E767D1_func126 + 28 (MYStaticClass.swift:0)
4   libdispatch.dylib             	0x4a53f07c _dispatch_client_callout + 6 (object.m:559)
5   libdispatch.dylib             	0x4a540100 _dispatch_once_callout + 14 (once.c:52)
6   libswiftCore.dylib            	0x44018d2a swift_once + 26 (once.h:111)
7   ...pp - MY APPLICATION	0x0041d616 HostingController.body.getter + 404 (MYStaticClass.swift:18)
8   ...pp - MY APPLICATION	0x0041d72a vtable thunk for WKHostingController.body.getter dispatching to HostingController.body.getter + 10 (<compiler-generated>:0)
9   SwiftUI                       	0x48cccf5a closure #1 in WKHostingController.hostingController.getter + 42 (WKHostingController.swift:32)
10  SwiftUI                       	0x48ccbbc0 WKHostingController.hostingController.getter + 32 (WKHostingController.swift:31)
11  SwiftUI                       	0x48ccc232 @objc WKHostingController.underlyingUIHostingController() + 18 (<compiler-generated>:0)
12  WatchKit                      	0x476cc89a -[SPRemoteInterface underlyingUIHostingControllerForInterfaceController:] + 46 (SPRemoteInterface.m:4974)
13  WatchKit                      	0x476cc844 -[SPExtensionConnection underlyingUIHostingControllerForInterfaceController:] + 90 (SPExtensionConnection.m:830)
14  WatchKit                      	0x476cc7c4 -[SPApplicationDelegate underlyingUIHostingControllerForHostingViewController:] + 100 (SPApplicationDelegate.m:2757)
15  WatchKit                      	0x476ca7da -[SPHostingViewController loadView] + 400 (SPHostingViewController.m:72)
16  UIKitCore                     	0x4560288e -[UIViewController loadViewIfRequired] + 160 (UIViewController.m:3464)
17  UIKitCore                     	0x455623d6 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 148 (UINavigationController.m:6689)
18  UIKitCore                     	0x4556267e -[UINavigationController _startTransition:fromViewController:toViewController:] + 136 (UINavigationController.m:6724)
19  UIKitCore                     	0x45563350 -[UINavigationController _startDeferredTransitionIfNeeded:] + 738 (UINavigationController.m:6948)
20  UIKitCore                     	0x455644ce -[UINavigationController __viewWillLayoutSubviews] + 126 (UINavigationController.m:7239)
21  UIKitCore                     	0x4554b3d4 -[UILayoutContainerView layoutSubviews] + 220 (UILayoutContainerView.m:86)
22  UIKitCore                     	0x45ef5166 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2010 (UIView.m:17526)
23  QuartzCore                    	0x4648fa42 -[CALayer layoutSublayers] + 232 (CALayer.mm:10147)
24  QuartzCore                    	0x46494d24 CA::Layer::layout_if_needed(CA::Transaction*) + 402 (CALayer.mm:10014)
25  QuartzCore                    	0x4649f3fe CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 62 (CALayer.mm:2485)
26  QuartzCore                    	0x4640a3d8 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 368 (CAContextInternal.mm:2449)
27  QuartzCore                    	0x4642bad0 CA::Transaction::commit() + 712 (CATransactionInternal.mm:449)
28  QuartzCore                    	0x4642ca72 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56 (CATransactionInternal.mm:932)
29  CoreFoundation                	0x418a4838 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18 (CFRunLoop.c:1799)
30  CoreFoundation                	0x4189fe64 __CFRunLoopDoObservers + 534 (CFRunLoop.c:1912)
31  CoreFoundation                	0x418a0340 __CFRunLoopRun + 832 (CFRunLoop.c:2953)
32  CoreFoundation                	0x4189fb22 CFRunLoopRunSpecific + 474 (CFRunLoop.c:3242)
33  GraphicsServices              	0x524cbeb6 GSEventRunModal + 134 (GSEvent.c:2259)
34  UIKitCore                     	0x45afc4f2 -[UIApplication _run] + 1044 (UIApplication.m:3253)
35  UIKitCore                     	0x45b01042 UIApplicationMain + 114 (UIApplication.m:4707)
36  WatchKit                      	0x476c6274 WKExtensionMain + 680 (main.m:107)
37  libdyld.dylib                 	0x5331bc32 start + 2

Thread 1:
0   libsystem_pthread.dylib       	0x6940ab48 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	0x6940ab48 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib       	0x6940ab48 start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib       	0x6940ab48 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib       	0x6940ab48 start_wqthread + 0

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib        	0x471978c0 mach_msg_trap + 20
1   libsystem_kernel.dylib        	0x47196f3a mach_msg + 42 (mach_msg.c:103)
2   CoreFoundation                	0x418a4f6c __CFRunLoopServiceMachPort + 338 (CFRunLoop.c:2641)
3   CoreFoundation                	0x418a03e4 __CFRunLoopRun + 996 (CFRunLoop.c:2974)
4   CoreFoundation                	0x4189fb22 CFRunLoopRunSpecific + 474 (CFRunLoop.c:3242)
5   Foundation                    	0x41bba596 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 180 (NSRunLoop.m:374)
6   Foundation                    	0x41bba4b2 -[NSRunLoop(NSRunLoop) runUntilDate:] + 76 (NSRunLoop.m:421)
7   UIKitCore                     	0x45b805b8 -[UIEventFetcher threadMain] + 140 (UIEventFetcher.m:838)
8   Foundation                    	0x41cdf628 __NSThread__start__ + 708 (NSThread.m:724)
9   libsystem_pthread.dylib       	0x69403e5e _pthread_start + 342 (pthread.c:881)
10  libsystem_pthread.dylib       	0x6940ab74 thread_start + 20

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib        	0x471978c0 mach_msg_trap + 20
1   libsystem_kernel.dylib        	0x47196f3a mach_msg + 42 (mach_msg.c:103)
2   CoreFoundation                	0x418a4f6c __CFRunLoopServiceMachPort + 338 (CFRunLoop.c:2641)
3   CoreFoundation                	0x418a03e4 __CFRunLoopRun + 996 (CFRunLoop.c:2974)
4   CoreFoundation                	0x4189fb22 CFRunLoopRunSpecific + 474 (CFRunLoop.c:3242)
5   AudioSession                  	0x493c6b16 GenericRunLoopThread::Entry(void*) + 126 (GenericRunLoopThread.h:91)
6   AudioSession                  	0x493c84bc CAPThread::Entry(CAPThread*) + 62 (CAPThread.cpp:321)
7   libsystem_pthread.dylib       	0x69403e5e _pthread_start + 342 (pthread.c:881)
8   libsystem_pthread.dylib       	0x6940ab74 thread_start + 20

fetchFromRealm function; (Function executed on main thread)
private func fetchFromRealm<T: Codable>(key:String,value:T) -> T {

guard let realm = try? Realm() else{
           return value
       }

       var data = Data()

            if key == "abc" {
                let crealm = realm.objects(CRealm.self)
                if crealm.count >= 1{
                    data = crealm[0].data
                    return data
                }
            }
            else if key == "xyz"{
                let chRealm = realm.objects(ChRealm.self)
                var chTmp = [MySwiftModel]()

                for ch in chRealm {
                    chTmp.append(// doing some stuff and adding ch to array)
                }

                return chTmp as! T
    }
    return value
  }

How is the function called?
MYStaticClass;

init(){
           fetchFromRealm(key: "abc", value: [array]())
            fetchFromRealm(key: "123", value: [array2]())
            fetchFromRealm(key: "xyz", value: [array3]())
}

Based on the error you have, it probably means the main thread tries to access a variable that has been freed or deallocated.
Prehaps you could try to test and run your application in Xcode with the Thread Sanitizer option checked. (Edit Scheme -> Run -> Diagnostics : Thread Sanitizer)
Also, do you know if this happens when there is a memory warning from the watchOS watchdog?
It might help you figure out what's going on.

Hello, nothing found with Thread Sanitizer.
This issue only occurs on watch 3 series with real device. I couldn't catch any error with simulator.
I don't have a watch 3 series, so I can't do a deep test.

@TheLuckyWan
By the way, the function is called like this way;
on MYStaticClass();
init(){
fetchFromRealm(key: "abc", value: array)
fetchFromRealm(key: "123", value: array2)
fetchFromRealm(key: "xyz", value: array3)
}

Hi @Turacbey, Thanks for sharing some info about this issue. As mentioned by @TheLuckyWan it looks like the thread is trying to access an object that has been already deallocated.
Because the issue happens only in a real device and you don't have access to it, maybe we can't try with the simulator and reproduce this issue. Can you please force a memory warning during test on simulator and see if you get the crash. You can do this on the debug menu -> Simulate Memory Warning

Hi @Turacbey, Thanks for sharing some info about this issue. As mentioned by @TheLuckyWan it looks like the thread is trying to access an object that has been already deallocated.
Because the issue happens only in a real device and you don't have access to it, maybe we can't try with the simulator and reproduce this issue. Can you please force a memory warning during test on simulator and see if you get the crash. You can do this on the debug menu -> Simulate Memory Warning

Hello @dianaafanador3. Thank you for your answer. I tried running the app simulating memory warning but I couldn't get any crash.
If you have any other suggestions, I would love to listen.

Hi @Turacbey, Can you share the project with us?, we can try to reproduce this issue in one of our devices, you can send it to diana.perez@mongodb.com.

Hi @Turacbey, Can you share the project with us?, we can try to reproduce this issue in one of our devices, you can send it to diana.perez@mongodb.com.

Hello @dianaafanador3, I am sorry, but the project belongs to our company and I can't share everything for now.
The app is live on the App Store and I can send you the link and maybe you can try debugging it on your devices.
If the above option doesn't work then I can create a new project for you with the crash part.

Hi @Turacbey, that will be great, we just want a way to be able to reproduce the issue

Hello @dianaafanador3,
I sent you the project.

Thanks @Turacbey we'll take a look at it.

Thanks @dianaafanador3

@Turacbey I'm trying to debug this on a Watch Series 2 with not much luck. Would you be able to tell us how big the Realm file is that causes the crash? I'm wondering if this is related to the Series 3 being 32bit and having limited address space.

@leemaguire  The crash happens only on watch series 3. There is no any crash from series se, series 5 or series 6 etc.
I don't know how big is the realm file, but it can not too big. I added some buttons that add items to arrays, I guess it is not bigger than 1000 items on each array.
Can you able to test it on watch series 3?

We will be waiting for someone who has watch series 3.

@Turacbey have you been able to solve this with the latest version of Realm? We require more information to proceed with an investigation as we do not possess a Watch Series 3.

Hi @leemaguire! I switched to CoreData over 7 months ago and changed my data structure long after that (not error related).
So for now there is no possibility to try it again with the latest version.

Ok- given that information I'll go ahead and close the issue.

authors: Turacbey dianaafanador3 leemaguire

repo: realm/realm-swift


text:
RLMGetSwiftPropertyString(obj, key)

How frequently does the bug occur?
Sometimes
Description
I think in old data there was set object NSNULL
from crash logs discovered:
public static func rlmGetPropertyOptional( obj: ObjectBase, _ key: PropertyKey) -> String? {
return RLMGetSwiftPropertyString(obj, key) <--- crash
}

Fatal Exception: NSInvalidArgumentException
-[NSNull _fastCStringContents:]: unrecognized selector sent to instance 0x1e19bd120
in old model was String as optional
used library UNRealm
after update to clear realm we discovered some crashes like:
Crashed: serial-queue
0  libobjc.A.dylib                0x5bd0 class_getSuperclass + 4
1  Realm                          0x5cf84 RLMIsObjectSubclass + 76
2  Realm                          0x13a3a0 RLMRegisterClassLocalNames(objc_class**, unsigned long) + 128
3  Realm                          0x13ac08 +[RLMSchema sharedSchema] + 104
4  Realm                          0x12cb90 +[RLMRealm realmWithConfiguration:queue:error:] + 1580

Stacktrace & log output
No response
Can you reproduce the bug?
Not yet
Reproduction Steps
No response
Version
10.28.2
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS
Build environment
Xcode Version 13.3.1 (13E500a)

also how about :
Fatal Exception: RLMException
std::bad_alloc
Fatal Exception: RLMException
0  CoreFoundation                 0x99d78 __exceptionPreprocess
1  libobjc.A.dylib                0x16734 objc_exception_throw
2  Realm                          0x1305e4 -[RLMRealm frozenCopy] + 1186 (RLMRealm.mm:1186)
3  Realm                          0x1353f4 RLMGetFrozenRealmForSourceRealm(RLMRealm*) + 91 (RLMRealmUtil.mm:91)
4  Realm                          0x1303c8 -[RLMRealm freeze] + 1167 (RLMRealm.mm:1167)
5  Realm                          0x5f9b8 RLMObjectFreeze + 511 (RLMObjectBase.mm:511)
6  RealmSwift                     0x6d5a4 specialized Realm.freeze(_:) + 953 (Realm.swift:953)
7  RealmSwift                     0x4d544 RealmSwiftObject.freeze() + 112 (Object.swift:112)

@mr-grey we will investigate the NSNull issue. For the second stack trace, could you send us a code sample of how you were using Realm? Were threads involved, was the app in the background etc?

there is callback:

static func getByPrimaryKey(uuid: String, realm: Realm? = try? Realm()) -> RealmUser? {
guard let realm = realm else { return nil }
return realm.object(ofType: RealmUser.self, forPrimaryKey: uuid)
}

What is the objective-c exception that it is throwing? Can you send the complete stack trace which would show this?

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x18c3b1d78 __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib               	0x1a5016734 objc_exception_throw + 60 (objc-exception.mm:565)
2   Realm                         	0x10ae545e4 -[RLMRealm frozenCopy] + 344 (RLMRealm.mm:1186)
3   Realm                         	0x10ae593f4 RLMGetFrozenRealmForSourceRealm(RLMRealm*) + 300 (RLMRealmUtil.mm:91)
4   Realm                         	0x10ae543c8 -[RLMRealm freeze] + 72 (RLMRealm.mm:1167)
5   Realm                         	0x10ad839b8 RLMObjectFreeze + 116 (RLMObjectBase.mm:511)
6   RealmSwift                    	0x10b7a95a4 specialized Realm.freeze<A>(_:) + 24 (Realm.swift:953)
7   RealmSwift                    	0x10b789544 $s10RealmSwift0A0V6freezeyxxSo13RLMObjectBaseCRbzlFSo0aB6ObjectCXD_Ti5 + 12 (Object.swift:0)
8   RealmSwift                    	0x10b789544 RealmSwiftObject.freeze() + 68
9   Me                            	0x1053ab414 MergedUser.init(uuid:) + 444 (MergedUser.swift:89)
10  Me                            	0x104fe4d6c $s2Me20RealmNamesUserEntityV04fullD0AA06MergedD0Vvg + 28 (RealmNamesUserEntity.swift:38)
11  Me                            	0x104fe4d6c specialized SmallUser.init(nameUser:) + 164 (SmallUser.swift:348)
12  Me                            	0x104fe5a34 $s2Me9SmallUserV04nameC0AcA010RealmNamesC6EntityV_tcfC + 12 (<compiler-generated>:0)
13  Me                            	0x104fe5a34 specialized static SmallUser.update(nameUser:) + 1104 (SmallUser.swift:195)
14  Me                            	0x10549e674 $s2Me9SmallUserV6update04nameC0AcA010RealmNamesC6EntityV_tFZ + 12 (<compiler-generated>:0)
15  Me                            	0x10549e674 RealmNamesUserEntity.smallUser.getter + 768
16  Me                            	0x104fef730 closure #1 in NamesGroupTVC.setup(entity:searchText:filter:onCellTapAction:) + 80 (NamesGroupTVC.swift:69)
17  Me                            	0x10525a6dc specialized MutableCollection<>._insertionSort(within:sortedEnd:by:) + 360
18  Me                            	0x105257db0 $sSMsSKRzrlE14_insertionSort6within2byySny5IndexSlQzG_Sb7ElementSTQz_AHtKXEtKFSry2Me20RealmNamesUserEntityVG_Tg5 + 68 (<compiler-generated>:0)
19  Me                            	0x105257db0 specialized UnsafeMutableBufferPointer._stableSortImpl(by:) + 204
20  Me                            	0x105257530 specialized MutableCollection<>.sort(by:) + 140
21  Me                            	0x105257470 specialized MutableCollection<>.sort(by:) + 36
22  Me                            	0x104fef230 $sSTsE6sorted2bySay7ElementQzGSbAD_ADtKXE_tKFSay2Me20RealmNamesUserEntityVG_Tg5 + 36 (<compiler-generated>:0)
23  Me                            	0x104fef230 NamesGroupTVC.setup(entity:searchText:filter:onCellTapAction:) + 636 (NamesGroupTVC.swift:68)
24  Me                            	0x1050f5f1c NamesDataManager.tableView(_:cellForRowAt:) + 676 (NamesDataManager.swift:250)
25  Me                            	0x1050f7be4 @objc NamesDataManager.tableView(_:cellForRowAt:) + 140 (<compiler-generated>:0)
26  UIKitCore                     	0x18ea0ef20 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1532 (UITableView.m:16287)
27  UIKitCore                     	0x18ec0c330 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 732 (UITableView.m:3093)
28  UIKitCore                     	0x18ea34118 -[UITableView _updateVisibleCellsNow:] + 1432 (UITableView.m:3230)
29  UIKitCore                     	0x18e811b98 -[UITableView _cellForRowAtIndexPath:usingPresentationValues:] + 248 (UITableView.m:7732)
30  UIKitCore                     	0x18ebb06bc -[UITableView cellForRowAtIndexPath:] + 80 (UITableView.m:7690)
31  Me                            	0x1050b0064 $sSo11UITableViewC2MeE27screenshotOfCellAtIndexPath05indexI0So7UIImageCSgSo07NSIndexI0C_tF + 72 (UITableView+Additions.swift:17)
32  Me                            	0x1050b0064 specialized UITableView.screenshotExcludingHeadersAtSections(excludedHeaderSections:excludingFootersAtSections:excludingRowsAtIndexPaths:) + 1148 (UITableView+Additions.swift:103)
33  Me                            	0x1050afbc0 $sSo11UITableViewC2MeE36screenshotExcludingHeadersAtSections014excludedHeaderH0016excludingFootersgH00k4RowsG10IndexPathsSo7UIImageCSgSo5NSSetCSg_A2MtF + 12 (UITableView+Additions.swift:7)
34  Me                            	0x1050afbc0 $sSo11UITableViewC2MeE10screenshotSo7UIImageCSgvg + 12 (<compiler-generated>:0)
35  Me                            	0x1050afbc0 @objc UITableView.screenshot.getter + 36
36  Me                            	0x1052291c4 closure #2 in NamesViewController.shareNameIntent(social:) + 84 (NamesViewController.swift:810)
37  Me                            	0x1051e7308 $sSo11UITableViewC2MeE10reloadData10completionyyyc_tFySbcfU_ + 4 (UITableView+.swift:51)
38  Me                            	0x1051e7308 partial apply for closure #1 in UITableView.reloadData(completion:) + 20 (<compiler-generated>:0)
39  Me                            	0x10500cc34 thunk for @escaping @callee_guaranteed (@unowned Bool) -> () + 40 (<compiler-generated>:0)
40  UIKitCore                     	0x18fa30e4c __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ + 36 (UIView.m:14960)
41  UIKitCore                     	0x18ea1a7f4 -[UIViewAnimationBlockDelegate _sendDeferredCompletion:] + 120 (UIView.m:15004)
42  libdispatch.dylib             	0x18c016e68 _dispatch_call_block_and_release + 32 (init.c:1517)
43  libdispatch.dylib             	0x18c018a2c _dispatch_client_callout + 20 (object.m:560)
44  libdispatch.dylib             	0x18c026f48 _dispatch_main_queue_drain + 928 (inline_internal.h:2622)
45  libdispatch.dylib             	0x18c026b98 _dispatch_main_queue_callback_4CF + 44 (queue.c:7770)
46  CoreFoundation                	0x18c36a2f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
47  CoreFoundation                	0x18c3241f4 __CFRunLoopRun + 2532 (CFRunLoop.c:3144)
48  CoreFoundation                	0x18c3376b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
49  GraphicsServices              	0x1a83d1374 GSEventRunModal + 164 (GSEvent.c:2200)
50  UIKitCore                     	0x18ec9ce88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
51  UIKitCore                     	0x18ea1e5ec UIApplicationMain + 364 (UIApplication.m:5064)
52  Me                            	0x104f152a8 main + 68 (AppDelegate.swift:33)
53  dyld                          	0x109051ce4 start + 520 (dyldMain.cpp:879)

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001c3d20b78 __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001fd33c3bc pthread_kill + 268 (pthread.c:1668)
2   libsystem_c.dylib             	0x00000001974ec44c __abort + 128 (abort.c:155)
3   libsystem_c.dylib             	0x0000000197494528 abort + 180 (abort.c:126)
4   libc++abi.dylib               	0x00000001a5121b7c abort_message + 132 (abort_message.cpp:78)
5   libc++abi.dylib               	0x00000001a51119c4 demangling_terminate_handler() + 336 (cxa_default_handlers.cpp:71)
6   libobjc.A.dylib               	0x00000001a501cc88 _objc_terminate() + 144 (objc-exception.mm:701)
7   FirebaseCrashlytics           	0x0000000109d11264 FIRCLSTerminateHandler() + 340 (FIRCLSException.mm:452)
8   Me                            	0x000000010550ca54 hmd_cpp_terminate_handle() + 380 (HMDCrashDetectCPP.mm:114)
9   libc++abi.dylib               	0x00000001a5120f18 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
10  libc++abi.dylib               	0x00000001a5120eb4 std::terminate() + 64 (cxa_handlers.cpp:88)
11  libdispatch.dylib             	0x000000018c018a40 _dispatch_client_callout + 40 (object.m:563)
12  libdispatch.dylib             	0x000000018c026f48 _dispatch_main_queue_drain + 928 (inline_internal.h:2622)
13  libdispatch.dylib             	0x000000018c026b98 _dispatch_main_queue_callback_4CF + 44 (queue.c:7770)
14  CoreFoundation                	0x000000018c36a2f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
15  CoreFoundation                	0x000000018c3241f4 __CFRunLoopRun + 2532 (CFRunLoop.c:3144)
16  CoreFoundation                	0x000000018c3376b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
17  GraphicsServices              	0x00000001a83d1374 GSEventRunModal + 164 (GSEvent.c:2200)
18  UIKitCore                     	0x000000018ec9ce88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
19  UIKitCore                     	0x000000018ea1e5ec UIApplicationMain + 364 (UIApplication.m:5064)
20  Me                            	0x0000000104f152a8 main + 68 (AppDelegate.swift:33)
21  dyld                          	0x0000000109051ce4 start + 520 (dyldMain.cpp:879)

Thread 1:
0   libsystem_pthread.dylib       	0x00000001fd335e54 start_wqthread + 0 (:-1)

also
then try to read :
@Persisted var phoneNumber

This may be related to https://github.com/realm/realm-swift/issues/8463

authors: leemaguire mr-grey nirinchev