Closed gchartier closed 1 year ago
Hi @gchartier, Mind sharing more details about your implementation or creating a REPL?
I cannot reproduce, this example works fine -> https://svelte.dev/repl/1e96cbd4bcd148e3b85a4c8ca76d7309?version=4.1.2
Thank you
Are you using Svelte 4?
Hi @gchartier, Mind sharing more details about your implementation or creating a REPL?
I cannot reproduce, this example works fine -> https://svelte.dev/repl/1e96cbd4bcd148e3b85a4c8ca76d7309?version=4.1.2
Thank you
I think you cannot reproduce it on REPL since it's ignoring typescript completely there.
Good point,
I just updated the repo example/ folder to the latest dependencies (including svelte 4) it's a typescript project and it works fine.
Please try and confirm,
I am using:
Here's the component where I'm getting the error on every usage of Pane:
<script lang="ts">
import ArchiveDirectoryFile from './ArchiveDirectoryFile.svelte';
import ArchiveDirectoryFolder from './ArchiveDirectoryFolder.svelte';
import ViewDocumentIcon from '$lib/icons/ViewDocumentIcon.svelte';
import { Pane, Splitpanes } from 'svelte-splitpanes';
import type { ExplorerItem } from '$lib/types';
export let directory: ExplorerItem[];
</script>
<section class="w-full min-h-full rounded-lg rounded-r-none">
{#if directory.length > 0}
<Splitpanes style="height: 400px">
<Pane minSize={20} maxSize={70}>
<ul class="menu menu-xs h-full bg-neutral text-neutral-content rounded-lg rounded-r-none">
{#each directory as item}
{#if item.type === 'file'}
<ArchiveDirectoryFile file={item} />
{:else if item.type === 'folder'}
<ArchiveDirectoryFolder folder={item} />
{/if}
{/each}
</ul>
</Pane>
<Pane maxSize={70}>
<div
class="flex gap-1 justify-center items-center h-full text-neutral-content my-auto bg-neutral rounded-lg rounded-l-none text-center font-light"
>
<ViewDocumentIcon fillColor="fill-neutral-content" />
<span>Select a file to view</span>
</div>
</Pane>
</Splitpanes>
{:else}
<p class="text-center">No files found.</p>
{/if}
</section>
@gchartier I cannot reproduce the issue.
The code above looks perfectly fine, and the typescript definition properly made it to the npm repo https://www.npmjs.com/package/svelte-splitpanes?activeTab=code
If you can't share the code base, I would recommend stripping down the code until you can isolate the issue.
I will be closing this issue - feel free to reopen once you can isolate the issue.
It seems to have resolved! 🤘
That's excellent news.
Whoever or whatever is it
;-)
Thanks for reporting.
I freshly installed and am getting an error on the Pane component:
Possible causes: