You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently developing a form page which has Svelte Select in it.
Here the example of the page code:
+page.svelte
<formmethod="POST"bind:this={forms} use:enhance>
<Selectname="select"on:change={()=>forms.requestSubmit()}
showChevron={true}
class="dark:!text-white dark:!bg-gray-700 !bg-gray-50"placeholder="Pilih atau cari nama sekolah"items={items}
/>
</form>
In order to display the items on to the <Select /> component, I loaded them in the +page.server.ts file
+page.server.ts
Here's the thing. When the page is loaded, it's giving me an error SyntaxError: Unexpected token < in JSON at position 0. I console log the params argument and it shows this
Even though I got an error, the <Select /> component is still displaying the data.
When I navigate to other page, and back again to this page, the [slugs] is back to normal as it should be
Any idea why or how to solve this?
Thank you
The text was updated successfully, but these errors were encountered:
I'm currently developing a form page which has Svelte Select in it.
Here the example of the page code:
+page.svelte
In order to display the items on to the
<Select />
component, I loaded them in the+page.server.ts
file+page.server.ts
Here's the thing. When the page is loaded, it's giving me an error
SyntaxError: Unexpected token < in JSON at position 0
. I console log theparams
argument and it shows thisEven though I got an error, the
<Select />
component is still displaying the data.When I navigate to other page, and back again to this page, the
[slugs]
is back to normal as it should beAny idea why or how to solve this?
Thank you
The text was updated successfully, but these errors were encountered: