Comments (8)
Please provide a reproduction or we can't help you.
from kit.
@dummdidumm How can i provide this to you?
from kit.
Per the issue template,
A link to a repository, or a fork of https://node.new/sveltekit, that reproduces the issue. Reproductions must be short, self-contained and correct and must not contain files or code that aren't relevant to the issue — please do NOT just paste a link to your project. Explaining how to reproduce is generally not enough. It pushes the burden of creating a reproduction project onto a small set of volunteer maintainers and isn't scalable. If no reproduction is provided, the issue will be closed.
from kit.
@Rich-Harris The problem is that i don't know what is causing this issue. The error message doens't give me any information i can work with. How would i know which part of the svelte app to share with you in the reproduction? Or do i put the entire repo in there in such a case?
from kit.
Try to remove parts of the app until the error no longer shows up. Then you know roughly in what area it appears. Then you can likely remove more stuff that is irrelevant. Then you can share the reproduction
from kit.
Thank you, that helped narrowing it down. I found the code that causes this issue, i don't understand why this is happening though.:
<script lang="ts">
import { ChevronRight, Phone, Mail, LucideTableCellsMerge, ChevronLeft } from 'lucide-svelte';
import { swiperSlideOUXNews } from '../data/slides';
import { onDestroy, onMount } from 'svelte';
let scrollElement = $state<HTMLElement>();
let currentSlide = $state(0);
const totalSlides = swiperSlideOUXNews.length;
function handleScroll() {
if (!scrollElement) return;
const slideWidth = scrollElement.offsetWidth;
const newIndex = Math.round(scrollElement.scrollLeft / slideWidth);
if (newIndex !== currentSlide) {
currentSlide = newIndex;
}
}
function nextSlide() {
currentSlide = (currentSlide + 1) % totalSlides;
scrollToCurrentSlide();
}
function prevSlide() {
currentSlide = (currentSlide - 1 + totalSlides) % totalSlides;
scrollToCurrentSlide();
}
function scrollToCurrentSlide() {
if (!scrollElement) return;
const slideWidth = scrollElement.offsetWidth;
scrollElement.scrollLeft = slideWidth * currentSlide;
}
$inspect(currentSlide);
onMount(() => {
if (scrollElement) {
scrollElement.addEventListener('scroll', handleScroll);
scrollToCurrentSlide();
return onDestroy(() => {
if (scrollElement) {
scrollElement.removeEventListener('scroll', handleScroll);
}
});
}
});
</script>
<section class="">
<div class="mt-20"></div>
<div class="ml-8 md:mx-52 md:text-center">
<div id="oux-news" class="leading-12 font-kanit text-5xl font-extrabold uppercase">
OMEGAUX<br class="md:hidden" /> NEWS
</div>
</div>
<div class="mb-8 ml-8 flex justify-start md:mx-52 md:justify-center">
<div class="mt-6 h-1 w-1/3 bg-flamingo-500 md:w-1/12"></div>
</div>
<div class="relative md:mt-20">
<div
class=" overflow flex snap-x snap-mandatory flex-row overflow-x-scroll"
bind:this={scrollElement}
>
{#each swiperSlideOUXNews as article, i}
<div id={article.sliderID} class=" w-screen flex-shrink-0 snap-start">
<div
class="flex min-h-60 items-center bg-cover md:mx-52"
style="background-image: url('{article.image}');"
>
<h1 class="p-12 text-2xl md:justify-center">{@html article.title}</h1>
</div>
<div class="flex flex-row justify-between border-b border-flamingo-500 p-6 md:mx-52">
<div class="flex">
<img
class="h-12 w-12 rounded-full object-cover"
src={article.authorImage}
alt={article.title}
/>
<div class="ml-4">
<h1 class="font-quattrocentoSans text-base font-bold">{article.author}</h1>
<h1 class="font-quattrocentoSans text-sm font-extralight">{article.date}</h1>
</div>
</div>
<!-- TODO Unhide and make into scheduling button? -->
<button class="hidden">
<img src="Button-Heart.svg" alt="HeartSVG" class=" h-12 w-12" />
</button>
</div>
<div class="border-b border-flamingo-500 bg-steel-gray-900 pb-6 md:mx-52">
<p class="px-8 pt-4 font-quattrocentoSans text-base">
{@html article.descriptionPath}
</p>
<!-- TODO Unhide and implement functionality -->
<img src="Button-Share.svg" alt="Share" class="mb-6 ml-8 mt-6 hidden h-10" />
</div>
</div>
{/each}
</div>
<button class="absolute left-0 top-24 z-50 md:left-32" onclick={prevSlide}>
<ChevronLeft class="h-10 w-10 text-slate-400 " />
</button><button class="absolute right-0 top-24 z-50 md:right-32" onclick={nextSlide}
><ChevronRight class="h-10 w-10" /></button
>
<div class="absolute right-4 top-48 flex space-x-2 md:right-80">
{#each Array(totalSlides) as _, index}
<button
class="h-2 w-2 rounded-full bg-flamingo-500 {index === currentSlide
? 'bg-flamingo-500'
: 'bg-white'}"
onclick={() => {
currentSlide = index;
scrollToCurrentSlide();
}}
></button>
{/each}
</div>
</div>
</section>
from kit.
This still isn't a reproduction as described in #12209 (comment). There's nothing we can do with this information.
from kit.
Hi Rich, sorry about that - i was able to find the issue with @dummdidumm guidance, the hydration error came up because i had inserted html from a string in {@html article.descriptionPath}. Thank you for your time. Best, Felix
from kit.
Related Issues (20)
- Sveltekit build not rendering HTML properly HOT 2
- CSS always bundled, even if component isn't referenced HOT 5
- When using Svelte 5 release candidate with SvelteKit + a base dir + trailing slashes set to "always" relative links break HOT 1
- enhanced:img should be considered a void element HOT 2
- "svelte-package" --tsconfig option ignores everything but compilerOptions
- Inflight Deprecation Warning HOT 19
- adapter-node upgrade lead to Memory Leak on SSR HOT 3
- svelte.config.js version changes cause most client chunks to generate a new hash despite no other changes HOT 7
- enhanced:img, imagetools, Sharp, and incorrectly rotated images HOT 6
- Cloudflare's Invocation routes cannot be replaced/extended [adapter-cloudflare] HOT 1
- `read()` does not support filename with space on macOS HOT 2
- `read()` does not support pathnames with `[param]` on macOS HOT 1
- Crawler does not crawl absolute URIs even if they are on `prerender.origin` HOT 1
- Static Site Generation HOT 2
- Override `vite/client` definitions
- adapter-cloudflare-workers: platformProxy persist configuration example is wrong HOT 1
- SVGs which are imported and used as a `background-image` via a CSS variable get incorrectly encoded as a data URI during build HOT 1
- Page won't auto reload during development if CSR is disabled HOT 2
- Source Code permission HOT 5
- Adapter vercel split option breaks form action HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kit.