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

Next JS build not compiling #192

Closed
brikiernan opened this issue Mar 27, 2022 · 2 comments
Closed

Next JS build not compiling #192

brikiernan opened this issue Mar 27, 2022 · 2 comments

Comments

@brikiernan
Copy link

brikiernan commented Mar 27, 2022

Hello,

I replaced react-dropzone with react-dropzone-uploader in a nextjs app and the code won't compile now.

From the error I'm getting I though maybe in my .tsconfig the skipLibCheck was not set to true but it is.

I'm not sure why typescript is checking your package?

Any ideas on this?

Thanks! Brian

Failed to compile.

./node_modules/react-dropzone-uploader/dist/Dropzone.tsx:504:44
Type error: Object 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


@brikiernan
Copy link
Author

brikiernan commented Mar 27, 2022

This issue #179 (comment) had the solution for me.

I had to set the "useUnknownInCatchVariables": true in my .tsconfig

@prmichaelsen
Copy link

not a fan of the solution above because it may swallow other important errors in your project. see #108 (comment)

i want to fix this myself but to be honest im not one hundred percent sure what's going on in their packaging scripts

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

No branches or pull requests

2 participants