From dd516265906dea5367af010131897e15ab1777b9 Mon Sep 17 00:00:00 2001 From: samarpit-santoki <128053569+samarpit-santoki@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:33:58 +0530 Subject: [PATCH] Fix: Production Build Fail Issue on Nextjs 14.1.0 When using react-dropzone-uploader in a next 14 project the production build fails with the following error message ```ts ./node_modules/react-dropzone-uploader/dist/Dropzone.tsx:504:44 Type error: 'e' is of type 'unknown'. 502 | params = await getUploadParams(fileWithMeta) 503 | } catch (e) { > 504 | console.error('Error Upload Params', e.stack) | ^ 505 | } 506 | if (params === null) return 507 | const { url, method = 'POST', body, fields = {}, headers = {}, meta: extraMeta = {} } = params error Command failed with exit code 1. ``` - giving type to the e solves the error --- src/Dropzone.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dropzone.tsx b/src/Dropzone.tsx index da29a80..07e1cc6 100644 --- a/src/Dropzone.tsx +++ b/src/Dropzone.tsx @@ -500,7 +500,7 @@ class Dropzone extends React.Component