-
-
Notifications
You must be signed in to change notification settings - Fork 52
TextField causes infinite loading and freezes the vite server #546
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
Comments
Hey @erlenddahl, it's not just you. I ran into this just last night and was very confused as well. I'm not sure what is causing it yet either. My initial hunch was maybe it is related to a recent reactivity regression with svelte (introduced in
With that said, the docs were on Which version of |
Actually I spoke too soon. It just locked up :( |
The last changes to
Then no changes since last October. Of the 2 changes, the binding inputs is the probably the most suspicious (it uses an object set to workaround). I've removed Btw, the |
Phew, nice to have that confirmed. I'll try with 0.77.0 at once. |
I was on Svelte 5.20.0, by the way. Sorry I didn't include this vital information earlier. Here's my complete package list now, with [email protected]:
Looks like it works now, actually. So then the bind:this change is probably the main suspect? Edit: five minutes later, and the minimal reproduction still runs after a lot of page refreshes. I also downgraded to 0.77.0 on my main project, and that seems to run properly as well. |
Removed I suspect the issue is the export let inputEl: HTMLInputElement | HTMLTextAreaElement | null = null;
// this is a workaround because Input only accepts an HTMLInputElement, not a TextAreaElement
const inputHolder = {
set input(value: HTMLInputElement | null) {
inputEl = value;
},
}; Now that I look at this, I think we can get rid of this workaround and just update the types on Creating a PR now. |
…karound for Input/textarea `bind:this` type differences as solution to fix Vite dev server freezing. Resolve #546
@erlenddahl Just released 0.90.2 with the (hopeful) fix. When you get a chance, can you verify? I'll keep an eye on it locally as well. |
Looks good in both my main project and the minimal reproduction so far. Nice, thank you very much for the swift response! |
No idea how the TextField could cause this, but I have reproduced it with a minimal example.
This originally happened in a larger SvelteKit app, where I suddently found that the routes with forms in them failed to load. After debugging for a while, I found that replacing TextFields with normal inputs seemed to solve the issue.
To reproduce it, I created a new SvelteKit app with npx sv create, and checked tailwindcss to be included. Then I ran npm install svelte-ux. I then updated tailwind.config.js, but the one on "Getting started" is outdated after the breaking 0.90 changes, so I had to find something that worked from the git repo instead.
I then created two routes: one with a simple input element (just for comparison), and one with a simple TextField element.
The one with the input element (/input) works completely normal. You can load the page, enter text, refresh the page as many times as you want.
The one with the TextField (/textfield) works on first load, but if you refresh it, the page will never stop loading. If you now try to open a new tab, nothing will load (Vite is completely frozen).
I have tried:
Nothing seems to help me. Have I done something very stupid, or is this some obscure bug somewhere?
Here are two different variants of the minimal reproduction:
[email protected], [email protected]
[email protected], [email protected]
The text was updated successfully, but these errors were encountered: