microsoft / microsoft/react-native-windows

Crash when trying to resolve JS promise on UI thread

Open
#10,707 10 comments 0 reactions 1 assignee View on GitHub

@vmoroz is already working on this.

Since Oct 14, 2022.

Area: Native Modules bug Workstream: Module Support
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

I made a native module which implements file picker.
and when I run it, the picker shows.
but shortly after picker has anywise closed, app crashes with no error log.
the info only I can find is error code 0xc0000005 from eventvwr.exe.

Steps To Reproduce
  1. do yarn add https://github.com/jihoobyeon/react-native-file-panel.git at your project
  2. run npx react-native run-windows --arch=x64
Expected Results

App still runs after closing the file picker.

CLI version

7.0.4

Environment
System:
OS: Windows 10 10.0.19044
CPU: (4) x64 AMD Ryzen 3 2200U with Radeon Vega Mobile Gfx
Memory: 21.43 GB / 31.63 GB
Binaries:
Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.18362.0, 10.0.19041.0, 10.0.22000.0
IDEs:
Android Studio: Not Found
Visual Studio: 16.11.32901.82 (Visual Studio Community 2019)
WebStorm 2022.1.4
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-windows: 0.68.18 => 0.68.18
Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2019

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

My module: https://github.com/jihoobyeon/react-native-file-panel/blob/main/windows/ReactNativeFilePanel/ReactNativeFilePanel.h

My App.tsx:

import React from 'react';
import { Button, Text, View } from 'react-native';
import { open, save } from 'react-native-file-panel';

export default class App extends React.Component<undefined, { text: string }> {
  constructor(props: undefined) {
    super(props);

    this.state = { text: '' };
  }
  render() {
    return (
      <View>
        <Button title='SAVE' onPress={ () => save('.txt', 'The quick brown fox jumps over the lazy dog.') } />
        <Button title='OPEN' onPress={ () => open('.txt').then((content: string) => this.setState({ text: content })) } />
        <Text>{ this.state.text }</Text>
      </View>
    );
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.