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

requested module does not provide an export named 'default' #17727

Closed
7 tasks done
Guna-meda opened this issue Jul 20, 2024 · 4 comments
Closed
7 tasks done

requested module does not provide an export named 'default' #17727

Guna-meda opened this issue Jul 20, 2024 · 4 comments

Comments

@Guna-meda
Copy link

Describe the bug

I am working on a react project.requested module '/src/components/ClockHeading.jsx' does not provide an export named 'default' .This is the error I am getting in console.I get this error, seemingly random. I cannot find a reason why it may happen but it can happen at any time when I save something in a file, it does not happen every time, just sometimes and it seems that for no reason, then it solves by itself after I save a few more times and/or I reload the page.And this happens in all projects not this alone.i am providing the code in which i am facing the issue pls resolve it asap.

Reproduction

https://github.com/Guna-meda/react/tree/main/src

Steps to reproduce

After i run dev it seems it work properly.But when i import functions from other file it shows error.I do default export .and i get the error - .requested module '/src/components/ClockHeading.jsx' does not provide an export named 'default' . in other projects i get the same error just the file name change and the import and export commands are also right.
Screenshot 2024-07-20 225639
Screenshot 2024-07-20 225712

System Info

Operating System: Edition	Windows 10 Pro
Version	22H2
Node.js Version: v20.15.0
npm : 10.7.0
Vite Version:"^5.3.4"
React Version:18.3.1
Browser and Version: Microsoft Edge
Version 126.0.2592.102
IDE : vs code 1.91.1

Used Package Manager

npm

Logs

No response

Validations

@nelsongollop
Copy link

nelsongollop commented Jul 20, 2024

Same thing happening to me. After the second or third save on the same file, hot reloading fails with that error. Undoing & redoing (basically doing nothing but re-saving the file) or re-starting vite solves the issue until it happens again.

With a quick search, found at least 4 other issues with the exact same problem, all of them closed because it couldn't be reproduced:
#11231
#14018
#11783
#15434

@Guna-meda
Copy link
Author

Same thing happening to me. After the second or third save on the same file, hot reloading fails with that error. Undoing & redoing (basically doing nothing but re-saving the file) or re-starting vite solves the issue until it happens again.

With a quick search, found at least 4 other issues with the exact same problem, all of them closed because it couldn't be reproduced: #11231 #14018 #11783 #15434

ya but this happens everytime. And doing this process each time is exhausting so i really need a permanent solution.

@psahni
Copy link

psahni commented Jul 28, 2024

Wasting my time and energy too

@Guna-meda
Copy link
Author

Guna-meda commented Jul 28, 2024 via email

@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants