57 Replies
there's a thousand ways that could be happening, you'll have to be more specific in what tooling you're using
also, it's generally considered a feature, not a bug, so I'm not sure it would be possible to disable it
put "liveServer.settings.ignoreFiles":["**"] in your settings.json file
a person in stackoverflow suggested this, but idk if its safe
im using vs code
vs code on its own does not reload pages when you save a file
are you using live server? Or vite? or some other tool?
yes live server
Like Jochem said, it's sort of one of the features... why do you want to disable it?
You could just open the HTML file instead of using live server, and refresh as needed 🤷 - that's how we used to do it back in the day 😄
in the bad old days 😄
actually when im in page 2 and editting the code and click save in vs code, im sent back to the first page
thats y
that isn't normal.
are you writing regular html/css/js, or are you making some sort of web app?
yup regular
html css js
so, if you go to page two, it's like localhost:3000/page-two.html in the address bar, or whatever?
actually its the same html page
but i made it look like its multiple pages
im making a multi page form
each step is like a page but its all in the same html file
ah, yeah okay, that makes sense then.
I'd just open the HTML file, instead of using live server. If you're using regular HTML/CSS/JS, the only benefit of using live server is to refresh on save.
If you're using JS modules you need a server and can't just open a file
JS modules require a secure context. IE they require HTTPS to use (or HTTP on local host)
oh
Besides, if steps 1, 2, and 3 all require input by the user, what's the point of changing the page and not reloading? You'll need to re-enter the info anyway
only step 1 requires input, but i didnt understand why we will require to reload the page in case all 3 steps require input by the user
When the page reloads any user input is gone. So you need to start over to get the input back
it resets the state of your JS too, by necessity
and any changes you made to the files on the server won't show up until the page reloads either
Also, "Select Plan" and "Add-ons" sounds like it's getting some input from the user
So, I guess my question is this:
Why don't you want the page to reload? It's a handy feature that allows changes to be shown immediately. If you don't want the changes to take effect…don't save the file :p
but my page is not reloading
we just have to select options from the given choices in those 2 steps
That's user input
This…makes no sense. You said the page is reloading and you want it to not. I'm asking why you want that
oh, it only reloads when i update the code through vs code
and i dont want it to reload when i update the code
Why don't you want the page to reload? It's a handy feature that allows changes to be shown immediately.
but how do i know if the changes i made, happened accordingly as i wished or not
You reload the page. If the changes worked as you wanted you'll see it
if you have python, you cab start a simple http server
can
php works as well
that should be enough to have a real server in case you need js modules
You cannot have changes in HTML or JS without reloading the page in the browser
and all the actions i performed on the page will be reset
im using html css js
yes, welcome to web development
woahhhhhhhh
Epic is just complicating the issue
if you need to keep your changes, store them in localstorage
so this is a world wide problem
i was answering to the one about js modules
"problem" isn't the right description. If you change JS code or HTML, your page needs to reload out of necessity. Running new code over the state of old code will cause weird issues, so the only way to be sure it'll work the way it's supposed to work is to clear the state and start over
hot module reloading tries to combat some of that, but even then you'll lose local state quite often when you change code
ohh
so what do i do
😔
try to limit the number of times you're editing code and retrying/reloading, minimize the amount of info you fill into the form, or even for development purposes set a value on the inputs if you really do have to fill out the form often
I'm sure there's browser plugins that can autofill your form for you too
btw
do u also face problems becuz of this
I wouldn't call it problems
but yes, my page needs to reload too when I make changes, and yes, my state then also gets cleared
save the changes in local storage
and on load, reset everything
that's not a reasonable thing to do if it's just for DX
if that's a feature the end-user would benefit from, sure
is it a backend thing (local storage?)
true, but if it is a multi-step form, it is something you MUST consider
no
it's in js
but if it's just annoying to fill out the form a couple dozen times during development, that's just asking to introduce more bugs and odd behavior
u mean saving the values as js variables?
no, in local storage
do u find it annoying
🤷
that is true, but if it is something the end user will have to re-do might as well add this
not everything in every hobby / job is enjoyable
btw i could just display: none all the other steps (pages) when im not working on them
big brain move?
not sure what that would solve?
oh, it would show you the next steps even without completing the first
i wont be sent to the first page whenever im saving the vs file
yeah, that works, if you're just working on the visuals
yeah
yes
it's jank but should work
okay