2

I have encountered a weird issue where I get the following error, when I re-generate my lock file.

Cannot find module" @mui/icons-material/Close imported from within one of my node_modules. Did you mean to import @mui/icons-material/Close.js.

That is, after I remove node_modules, clean npm cache, delete lock file, install packages, the error occurs. The "@mui/icons-material" is already installed after this, so it is bewildering to me why it cannot find the module. I have tried with both yarn and npm.

Everything works fine if I just keep the original lock file. And I have checked that the package is only installed once.

For context, I am using nextjs + react + typescript + node v16.19.1 + npm v9.5.0 + yarn v1.22.19

This is the call Stack:

enter image description here

Burger Bob
  • 131
  • 3

1 Answers1

0

In the end, I found out it is caused by the @solana/solana-wallet-adapter-material-ui package in package-lock.json. If it gets updated it will complain, so I just need to have the version as is. It got updated to v0.16.26. I just needed it to stay at v0.16.22.

Burger Bob
  • 131
  • 3
  • 1
    While it's great you figured this out, you need to post all necessary details when you ask a question - in this case - you should have posted your package.json. – Ayudh Feb 21 '23 at 02:09
  • @Ayudh you are right, you would probably be able to reproduce it if you had the same package.json. Will remember for the next time! – Burger Bob Feb 21 '23 at 08:40