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: Named export 'useDropzone' not found error #4920

Closed
sunadoi opened this issue Sep 29, 2023 · 3 comments
Closed

Next.js: Named export 'useDropzone' not found error #4920

sunadoi opened this issue Sep 29, 2023 · 3 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@sunadoi
Copy link
Contributor

sunadoi commented Sep 29, 2023

What package has an issue

@mantine/dropzone

Describe the bug

I just updated to v7 on my Next.js project (pages router) and came across the following error on a component using dropzone:

import { useDropzone } from 'react-dropzone';
         ^^^^^^^^^^^
SyntaxError: Named export 'useDropzone' not found. The requested module 'react-dropzone' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'react-dropzone';
const { useDropzone } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:308:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:428:15) {
  page: '/'
}

See repro.
Simply added a dropzone component from next-pages-template

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7.1.0

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/p/sandbox/wandering-resonance-wjrrcp?file=/pages/_app.tsx:24,1

Do you know how to fix the issue

None

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

@rtivital
Copy link
Member

It is a known issue with react-dropzone – react-dropzone/react-dropzone#1259
Nothing can be done on our side until react-dropzone is updated

@rtivital rtivital added Fix Unknown It is not clear whether the can be resolved Fixed patch Completed issues that will be published with next patch (1.0.X) and removed Fix Unknown It is not clear whether the can be resolved labels Sep 29, 2023
rtivital added a commit that referenced this issue Oct 1, 2023
@sunadoi
Copy link
Contributor Author

sunadoi commented Oct 2, 2023

Thanks for migrating to the esm package!
Looking forward to this being released!

@rtivital
Copy link
Member

rtivital commented Oct 2, 2023

Fixed in 7.1.1

@rtivital rtivital closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants