Skip to content
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

Error "500 item is not defined" when add spinner #21

Closed
brud opened this issue May 3, 2021 · 3 comments
Closed

Error "500 item is not defined" when add spinner #21

brud opened this issue May 3, 2021 · 3 comments

Comments

@brud
Copy link

brud commented May 3, 2021

When I add spinner inside a slidy tag:

<Slidy {...slidy_default}>
  <span slot="loader">
    <Spinner/>
  </span>
</Slidy>

error appears:

item is not defined
ReferenceError: item is not defined
    at eval (/node_modules/svelte-slidy/src/Slidy.svelte:414:91)
    at Object.$$render (C:\Users\brud9\projects\_vitbad\node_modules\svelte\internal\index.js:1412:22)
    at index.svelte:60:11
    at Object.$$render (C:\Users\brud9\projects\_vitbad\node_modules\svelte\internal\index.js:1412:22)
    at Object.default (root.svelte:38:46)
    at eval (C:\Users\brud9\projects\_vitbad\src\routes\$layout.svelte:26:66)
    at Object.$$render (C:\Users\brud9\projects\_vitbad\node_modules\svelte\internal\index.js:1412:22)
    at root.svelte:36:44
    at $$render (C:\Users\brud9\projects\_vitbad\node_modules\svelte\internal\index.js:1412:22)
    at Object.render (C:\Users\brud9\projects\_vitbad\node_modules\svelte\internal\index.js:1420:26)

I was trying to add let:item but no result.

Slidy v. 2.6.3
Svelte v. 3.38.1
SvelteKit v. 1.0.0-next.95

@brud
Copy link
Author

brud commented May 3, 2021

It looks like SSR issue, for now I create a monkey patch:

<style lang="stylus">
	.preloader
		width 100%
		height 49vh // same as wrap in slidy options
		display flex
		justify-content center
		align-items center
</style>

{#if (browser) }
	<Slidy {...slidy_default}>
		<span slot="loader">
			<Spinner/>
		</span>
	</Slidy>
{:else }
	<div class="preloader">
		<Spinner/>
	</div>
{/if}

@Valexr
Copy link
Owner

Valexr commented Jun 1, 2021

Tx for SSR testing... I thinking what can I do for this issue...
& it's not monkey patch - it recommended setting 🤓 in SvelteKit

@Valexr
Copy link
Owner

Valexr commented Jul 8, 2021

it's true way {#if (browser) } for realise loader behaviour in SSR mode in SvelteKit.
I'm close this issue... if you have other questions, welcome 🤓

@Valexr Valexr closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants