-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
pnpm dev
breaks; pnpm build
works with #each
block in +layout.svelte
#10508
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
pnpm dev
breaks; pnpm build
with #each
block in +layout.svelte
pnpm dev
breaks; pnpm build
works with #each
block in +layout.svelte
This somewhat works as expected. The {#each iframeModals as iframe, i}
<IframeModal bind:iframe={iframeModals[i]} delay={500} />
{/each} then it works as expected in both dev and prod. Is there a reason you did not bind, or was the error confusing / not obvious what it's related to? |
As far as the code you wrote, I actually proposed that myself as a workaround in the original issue 10437. In that original issue I actually pointed out a couple of bugs (will keep it to 1 bug per issue from now on so things aren't prematurely closed). Back to my concerns in this issue:
<!-- +layout.svelte -->
{#each iframeModals as iframe}
<IframeModal {iframe} />
{/each}
<!-- IframeModal.svelte -->
<Modal css isOpen={iframe.isOpen} close={() => (iframe.isOpen = false)}>
<Suspense loading={iframe.loading}>
<iframe src={iframe.url} use:load_iframe={iframe} title={iframe.name} />
</Suspense>
</Modal> This same code snippet is used directly in the commented out <!-- IframeModals.svelte -->
{#each iframeModals as iframe}
<Modal css isOpen={iframe.isOpen} close={() => (iframe.isOpen = false)}>
<Suspense loading={iframe.loading}>
<iframe src={iframe.url} use:load_iframe={iframe} title={iframe.name} />
</Suspense>
</Modal>
{/each} 3.. ... so that things are a little simpler I'll get rid of broken_demo.mp4
|
I rescind my apology from the previous edit. Somehow alpha 64 just fixes things 🤷♀️ (which now officially closes closed issues 10437 and 10473). I can now use the 'unbound' case mentioned above. Strangely in a svelte 4 variant making the following change: // IframeModal.svelte
export let frame: iframeModalType
- function load_iframe(node: HTMLIFrameElement, iframe: iframeModalType) {
+ function load_iframe(node: HTMLIFrameElement) { fixed it ... but that is not necessary in the svelte 5 version. Still don't understand how before alpha 64 the PROD svelte 5 version worked and the DEV one broke. |
Describe the bug
This relates to closed issues (10437 and 10473).
@dummdidumm below is a video to better illustrate my issue.
The video starts with the working case (i.e. using
pnpm build
). When I then try withpnpm dev
the demo breaks (modal doesn't transition away ... gets stuck).Not explicitly shown in the video (but right underneath and commented out) is another component
<IframeModals/>
, which uses the#each
block internally ... and it works both withpnpm dev
andpnpm build
. I have also updated the SvelteLab repro using alpha 56 so you can test this outbroken_modal.mp4
Reproduction
SvelteLab demo
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: