something strange when developing:can't enable HMR #2437

Closed
opened 2025-11-11 15:07:17 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @maru7777 on GitHub (Oct 23, 2024).

Feature Request

Important: Before submitting a feature request, please check whether a similar issue or feature request has already been posted in the Issues or Discussions section. It's likely we're already tracking it. In case of uncertainty, initiate a discussion post first. This helps us all to efficiently focus on improving the project.

Let's collaborate respectfully. If you bring negativity, please understand our capacity to engage may be limited. If you're open to learning and communicating constructively, we're more than happy to assist you. Remember, Open WebUI is a volunteer-driven project maintained by a single maintainer, supported by our amazing contributors who also manage full-time jobs. We respect your time; please respect ours. If you have an issue, We highly encourage you to submit a pull request or to fork the project. We actively work to prevent contributor burnout to preserve the quality and continuity of Open WebUI.

Is your feature request related to a problem? Please describe.
when i try to develpoe , i find something wierd
when i follow 'Delelopement guide'
image
it use npm run dev,but after start backend ,it shows
image
'serving API only','can not find build ',that means i don't build it and backend can only offer api,but no UI interface
if you go to http://127.0.0.1:8080/ it will say:
image
if you go to http://127.0.0.1:8080/docs ,it will show normally
image
go to ttp://localhost:5174/ it can show UI but redirect to ttp://localhost:5174/error

so i keep find and find another guide in 'updating Open webUI'
it shows
image
the difference is npm run dev/build
this time after i run npm run build ,there will be a build forder in root path, and everthing seemsto be fine
so i think this is wierd
and after reading some code i change some code and want see what changes
this time , i find another issuse:

if i run 'npm run build', i think it will immediately restart the page , update it and show my change,
only after run npm run buuld,it takes 3min,and then i can see my code really change
but if you run npm run dev ,this can't apply your modification immediately, it is wierd that vite.js support hot update / hmr like next.js vue.js, every framework if you change anything the framework will reload the page immediately and you can see the change,and npm run dev should be the right instruction to enable this feathure
and if you only run npm run dev and you accessttp://localhost:5174/,it will remind you you can't use 'only front mode',even you have already start backend
'"Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend'
run npm run build will take effect but it takes so much time evey time,now i can only use this way to apply my change
now only after run 'npm run build' can we see the UI :the python code will alse detect if you have build folder,if you don't have build folder it will not mount the webui

any idea?

Describe the solution you'd like
i hope i can develope code under npm run dev' wtihout running 'npm run build, i hope to see my code change immediately,not build eveytime ,it helps developing
i hope we don't need to build it every time
and now only after run 'npm run build' can we see the UI, the guide may need some change to make this more clear

Describe alternatives you've considered
i am not familiar with this project,maybe we should not use Pyodide in the front end?

Additional context
can anyone can give some ideas on how to enable Hot Module Replacement (HMR)? i tried

Originally created by @maru7777 on GitHub (Oct 23, 2024). # Feature Request **Important: Before submitting a feature request, please check whether a similar issue or feature request has already been posted in the Issues or Discussions section. It's likely we're already tracking it. In case of uncertainty, initiate a discussion post first. This helps us all to efficiently focus on improving the project.** **Let's collaborate respectfully. If you bring negativity, please understand our capacity to engage may be limited. If you're open to learning and communicating constructively, we're more than happy to assist you. Remember, Open WebUI is a volunteer-driven project maintained by a single maintainer, supported by our amazing contributors who also manage full-time jobs. We respect your time; please respect ours. If you have an issue, We highly encourage you to submit a pull request or to fork the project. We actively work to prevent contributor burnout to preserve the quality and continuity of Open WebUI.** **Is your feature request related to a problem? Please describe.** when i try to develpoe , i find something wierd when i follow 'Delelopement guide' ![image](https://github.com/user-attachments/assets/666c14dd-bf69-42e1-aa5f-7a2a41184fb2) it use `npm run dev`,but after start backend ,it shows ![image](https://github.com/user-attachments/assets/b670e570-eec9-4334-a32a-4feb884222fb) 'serving API only','can not find build ',that means i don't build it and backend can only offer api,but no UI interface if you go to http://127.0.0.1:8080/ it will say: ![image](https://github.com/user-attachments/assets/0bef5109-be50-439d-8b0b-23c04ac52603) if you go to http://127.0.0.1:8080/docs ,it will show normally ![image](https://github.com/user-attachments/assets/0e25cd26-e636-496e-be42-a6fc65ae5cb8) go to ttp://localhost:5174/ it can show UI but redirect to ttp://localhost:5174/error so i keep find and find another guide in 'updating Open webUI' it shows ![image](https://github.com/user-attachments/assets/4f5a5127-2dc8-4449-a9da-3c4dd080f475) the difference is npm run dev/build this time after i run npm run build ,there will be a build forder in root path, and everthing seemsto be fine so i think this is wierd and after reading some code i change some code and want see what changes this time , i find another issuse: if i run 'npm run build', i think it will immediately restart the page , update it and show my change, only after run `npm run buuld`,it takes 3min,and then i can see my code really change but if you run `npm run dev` ,this can't apply your modification immediately, it is wierd that vite.js support hot update / hmr like next.js vue.js, every framework if you change anything the framework will reload the page immediately and you can see the change,and `npm run dev` should be the right instruction to enable this feathure and if you only run `npm run dev ` and you accessttp://localhost:5174/,it will remind you you can't use 'only front mode',even you have already start backend '"Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend' run `npm run build` will take effect but it takes so much time evey time,now i can only use this way to apply my change now only after run 'npm run build' can we see the UI :the python code will alse detect if you have build folder,if you don't have build folder it will not mount the webui any idea? **Describe the solution you'd like** i hope i can develope code under `npm run dev' wtihout running 'npm run build`, i hope to see my code change immediately,not build eveytime ,it helps developing i hope we don't need to build it every time and now only after run 'npm run build' can we see the UI, the guide may need some change to make this more clear **Describe alternatives you've considered** i am not familiar with this project,maybe we should not use Pyodide in the front end? **Additional context** can anyone can give some ideas on how to enable Hot Module Replacement (HMR)? i tried
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#2437