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

I got error while using it in next js #38

Closed
bilalmohib opened this issue Sep 6, 2023 · 2 comments
Closed

I got error while using it in next js #38

bilalmohib opened this issue Sep 6, 2023 · 2 comments

Comments

@bilalmohib
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Install using
// with npm
npm install mui-file-input

// with yarn
yarn add mui-file-input
  1. Use typescript in your project
  2. Just use sample code provided here : https://www.npmjs.com/package/mui-file-input
  3. Use Next JS latest version
  4. You will see the following error
    Failed to compile
    ./node_modules/@mui/material/node_modules/react-is/index.js
    Module build failed: Error: ENOENT: no such file or directory, open '/workspaces/AlumTecRedesign/node_modules/@mui/material/node_modules/react-is/index.js'

Expected behavior
It must work as a normal file picker but it dosent work in next js

Screenshots
Here is the screenshot of the error
Screenshot 2023-09-06 at 10 58 16 PM

Desktop (please complete the following information):

  • OS: MAC OS(Mac Book Pro)
  • Browser : Chrome
  • Version : 116.0.5845.140 (Official Build) (x86_64)

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser N/A
  • Version N/A

Additional context
Using next js latest version and using typescript and tailwind css also but dont know the reason for error

@viclafouch
Copy link
Owner

Hello ! Could you share a codesandbox for repro plz ?

@rifqiahmadf
Copy link

Hi @bilalmohib, I ran with the same issue and solved by updating the next.config.js
I hope this code will help you too!

module.exports = {
    transpilePackages: ['mui-file-input],
    /* Your Next.js config */
};

My project:
...
"next": "13.2.4",
"@mui/material": "^5.14.5",
"mui-file-input": "^3.0.2",
...

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

3 participants