-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
func name with uppercase letter cause hot reload failure? #6885
Comments
I can't reproduce the behaviour you described. Please create a minimal reproduction, e.g. GitHub repo or stackblitz to help show the bug. |
Hello @yukilzw. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
https://github.com/yukilzw/issue-vite-project Easy to reproduce, I used vite npm command to create a new repository and just split the original template code into |
I was able to reproduce as well by cloning the repo above on Node v16. When updating the content in the
However when I created a new vite project and created a component by the same name. HMR worked as expected. |
It is related to the reference path of the component. According to my test, If you put all the components and function in root file, there is no problem. So you can find what's the different from mine.I just changed reference path of the default vite project template. |
Turns out, this seems to be the same problem when naming fileNames with a capital letter in the name but not the first letter. As a result, HMR function fails to work for those files. Took me nearly two days to figure this out. |
Got same problem as above |
I dig into this problem, and found it's the intentional behavior of
|
@ZYSzys Holy moly, thank you for digging into this and identifying the root cause. I was fairly new to Vue + Vite when i ran into this problem and wasn't sure how to find the root cause. I had issues digging into it. My solution was to begin lowercasing everything as much as I didn't want to. |
Describe the bug
Use react template. When a function name that starts with an uppercase letter in a component, hot reload was fail, It only can refreshed browser unless the function is changed to lowercase:
// hot reload fail
const Func = () => null;
export default () => 123;
// hot reload success
const func = () => null;
export default () => 123;
Reproduction
issue-mini-project
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: