Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Production Build Fail Issue on Nextjs 14.1.0 #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samarpit-santoki
Copy link

When using react-dropzone-uploader in a next 14 project the production build fails with the following error message

./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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant