rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.26k stars 175 forks source link

Uncaught (in promise) ReferenceError: items is not defined at Array.create_default_slot_4$1 #476

Closed kasparpalgi closed 1 year ago

kasparpalgi commented 1 year ago

Hey, when I set the exact same array:

const items = [
    {
      value: "whatsapp",
      label:
        "<img src='https://projects.crewnew.com/crewnew/img/icons/wa.png' width='12' alt='WhatsApp'> WhatsApp",
    },
    {
      value: "discord",
      label:
        "<img src='https://projects.crewnew.com/crewnew/img/icons/discord.png' alt='Discord'> Discord",
    },
    {
      value: "facebook",
      label:
        "<img src='https://projects.crewnew.com/crewnew/img/icons/fb.png' alt='Messenger'> Facebook Messenger",
    },
  ];

then works fine but when I fetch from the API then it just doesn't work although I get EXACT the same array as you can see from the console.log: https://i.imgur.com/8vkdZK1.png

kasparpalgi commented 1 year ago

OK, when I <pre> it instead console.log then I get [object Object] so I guess my poor JS skills are the issue here.