Code Monkey home page Code Monkey logo

Comments (8)

fcrozatier avatar fcrozatier commented on July 19, 2024 1

After experimenting with all html elements, the full list of affected ones is a superset of the void elements:

area base br caption colgroup embed frame frameset head hr img input link meta param source tbody td template textarea tfoot th thead tr track wbr

from svelte.

HighFunctioningSociopathSH avatar HighFunctioningSociopathSH commented on July 19, 2024

upon further tries I noticed that the reactivity on the said svelte:elements does not work at all. You can even try to set an id for the element but the id will never update. nothing happens on the client side.

<svelte:options runes />

<script lang="ts">
  let id = $state("something");

  setTimeout(() => {
    id = "something else"
  }, 2000)
</script>

<svelte:element this="input" {id}></svelte:element>

from svelte.

brunnerh avatar brunnerh commented on July 19, 2024

Both of those examples work in the REPL for me.
REPL 1 REPL 2

from svelte.

HighFunctioningSociopathSH avatar HighFunctioningSociopathSH commented on July 19, 2024

@brunnerh interesting. but I'm sure that it doesn't work like it should. would you be able to confirm your results on your local machine? Since REPL runs entirely on the client side the results might be different from your own environment. maybe a serverside code causes a crash of some sort?!

And if your results stay the same what could be causing my system to act this way?

from svelte.

brunnerh avatar brunnerh commented on July 19, 2024

Looks like an SSR/hydration issue, may also be SvelteKit specific.
Works locally without SSR but breaks with SSR.

Dev and build both seem to give same results.

"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-node": "^5.0.1",
"@sveltejs/kit": "^2.5.5",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"svelte": "^5.0.0-next.95",

(Btw, stuff like setTimeout should be guarded with something like onMount or if (browser) if you have SSR. Actions only run on the client anyway.)

from svelte.

HighFunctioningSociopathSH avatar HighFunctioningSociopathSH commented on July 19, 2024

(Btw, stuff like setTimeout should be guarded with something like onMount or if (browser) if you have SSR. Actions only run on the client anyway.)

I see. thanks for the tip.

from svelte.

fcrozatier avatar fcrozatier commented on July 19, 2024

All the void elements are affected by this bug.

See the reproduction here

Strangely it works as intended (not buggy) in the REPL

from svelte.

Rich-Harris avatar Rich-Harris commented on July 19, 2024

closed via #11258

from svelte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.