Medusajs SyntaxError: The requested module does not provide an export named - Unexpected Application Error

618 Views Asked by At

I encountered an unexpected application error with the following error message:

> cd medusa-store/admin
> yarn start

"SyntaxError: The requested module '/node_modules/.vite/deps/medusa-react.js?v=b30cf161' does not provide an export named 'useAdminAddLocationToSalesChannel'"

This error occurred while working on my application. I'm trying to access medusa admin, and it seems to be missing the expected export. I have tried various troubleshooting steps, but I haven't been able to resolve the issue.

Has anyone encountered a similar error with with the admin or encountered a similar issue where a module is missing an expected export? Any suggestions on how to resolve this issue or any insights would be greatly appreciated.

Additionally, I noticed the error message suggests providing a better user experience when the application throws errors by utilizing an ErrorBoundary or errorElement prop on the route. If anyone has insights or examples on implementing an ErrorBoundary or errorElement prop, I would greatly appreciate it.

Thank you in advance for your assistance!

1

There are 1 best solutions below

0
On

I was able to resolve it by upgrading to version medusa-react to version 8. By running the command yarn add medusa-react, I updated the package and the problem was solved. However, found this notice from the main repo

that Medusa React is currently in maintenance mode, and as of June 1st, 2023, it will reach end-of-life. The Medusa Admin has been moved to the core repository as a plugin through npm. If you're interested in trying out the new admin, you can refer to the 1.8 release notes for guidance. If you encounter any bugs, it's recommended to report them in both repositories. Thank you and see you there!