code=null #904
Unanswered
bhabani-3998
asked this question in
Q&A
code=null
#904
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The PDF compression is finishing correctly, but the crash is coming from inside the native code of @react-native-documents/picker after your JS finishes, because some internal Promise.reject(code, message) is being called with code = null
[PDF] iteration: 1, shrinkFactor: 0.70, size: 236.84 KB, path: /data/user/0/com.onebi.ffm.dev/cache/compressed_1765374947383.pdf
ImageFileUpload.ts:217 [PDF] iteration: 2, shrinkFactor: 0.60, size: 203.00 KB, path: /data/user/0/com.onebi.ffm.dev/cache/compressed_1765374947383.pdf
ImageFileUpload.ts:217 [PDF] iteration: 3, shrinkFactor: 0.50, size: 169.17 KB, path: /data/user/0/com.onebi.ffm.dev/cache/compressed_1765374947383.pdf
ImageFileUpload.ts:217 [PDF] iteration: 4, shrinkFactor: 0.40, size: 135.34 KB, path: /data/user/0/com.onebi.ffm.dev/cache/compressed_1765374947383.pdf
ImageFileUpload.ts:217 [PDF] iteration: 5, shrinkFactor: 0.30, size: 101.50 KB, path: /data/user/0/com.onebi.ffm.dev/cache/compressed_1765374947383.pdf
ImageFileUpload.ts:245 [PDF] compressPdfFromPickedUri error: Error: Exception in HostFunction: Parameter specified as non-null is null: method com.facebook.react.bridge.PromiseImpl.reject, parameter code
VM11 &platform=android&dev=true&lazy=true&minify=false&app=com.onebi.ffm.dev&modulesOnly=true&runModule=true&sourcePaths=url-server&shallow=true:187 Error picking pdf (full): Error: Exception in HostFunction: Parameter specified as non-null is null: method com.facebook.react.bridge.PromiseImpl.reject, parameter code
const handlePickPdf = async () => {
setShowFilePicker(false);
try {
const res = await RNDocumentsPicker.pick({
mode: "import",
allowMultiSelection: false,
fileTypes: ["com.adobe.pdf"],
});
export const compressPdfFromPickedUri = async (
pickedUri: string,
maxKB: number
): Promise<{ uri: string; sizeKB: number; type: 'pdf' }> => {
try {
console.log('[PDF] compressPdfFromPickedUri called with:', pickedUri);
};
Beta Was this translation helpful? Give feedback.
All reactions