Skip to content

Possible Unhandled Promise Rejection  #484

Closed
@scrapecoder

Description

@scrapecoder

Bug report

Summary

Select_File = async () => {
	const { formData } = this.state;


	try {
		
		const res = await DocumentPicker.pick({
			type: [DocumentPicker.types.images, DocumentPicker.types.pdf]
		});

		this.setState({
			fileformData: [{ uri: res.uri, type: res.type, name: res.name }]
		});
	} catch (err) {
		
		if (DocumentPicker.isCancel(err)) {
			// User cancelled the picker, exit any dialogs or menus and move on
		} else {
			throw err;
		}
	}
};

Steps to reproduce

Whenever I'm calling Select_File fun, i'm getting warning Possible Unhandled Promise Rejection (id: 11): TypeError: null is not an object (evaluating 'RNDocumentPicker.pickDirectory') pickDirectory@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:202901:34
in emulator/real device.
I also tried with the different versions of react-native-document-picker but I'm getting this warning in all versions.

Environment info

npx react-native info output:

"react": "16.9.0",
"react-native": "0.61.5",
"react-native-document-picker": "5.2.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions