[React Error]Uncaught SyntaxError: The requested module does not provide an export named



1. Problem

When build project of React, i see this under error. I can see this error on chrome console. This makes problem. I cannot see anything on my local enviroment. I have to fix this problem.

Component.tsx:31 Uncaught SyntaxError: The requested module ‘/@fs/Users/user/Programming/react_project/node_modules/.vite/web/deps/@ui_core.js’ does not provide an export named ‘OnContainer’ (at Component.tsx:31:1)

2. Solution

$ yarn cache clean
$ yarn install

You can try above command. You have to clean cache of react.

$ rm -rf node_modules/.cache
$ rm -rf node_modules/.vite

If you tried but not fixed, you can try rm -rf command. In my case, my trouble solved by this command.