#"InvalidComponentArgs: Invalid arguments passed to <Foo> component" with no errors on editor.

4 messages · Page 1 of 1 (latest)

olive vale
#

hello! before i begin, i'd like to mention i've just started out with Astro about two weeks ago. i'm absolutely loving it, but if i've missed out on anything simple here please do let me know.

i'm trying to implement a search function with Solid where I have the following layout on the /search path, and @/components/Search.tsx looks like this

i think i've done everything correctly - with no errors from VSCode extension regarding TypeErrors. here's the error i get in the browser console when i start typing in the search box:

Uncaught InvalidComponentArgs: Invalid arguments passed to <ArrowCard> component.
    AstroError errors.js:13
    fn astro-component.js:11
    c dev.js:623
    untrack dev.js:505
    c dev.js:619
    runComputation dev.js:788
    updateComputation dev.js:767
    devComponent dev.js:634
    createComponent dev.js:1393
    Search2 Search.tsx:63
    Search2 Search.tsx:65
    Search2 Search.tsx:63
    insert dev.js:706
    runComputation dev.js:788
    updateComputation dev.js:767
    runTop dev.js:883
    runUserEffects dev.js:981
    completeUpdates dev.js:952
    runUpdates dev.js:900
    completeUpdates dev.js:952
    runUpdates dev.js:901
    completeUpdates dev.js:952
    runUpdates dev.js:901
    writeSignal dev.js:739
    setter dev.js:217
    onInput Search.tsx:37
    eventHandler dev.js:868
    delegateEvents dev.js:597
    <anonymous> Search.tsx:73
undefined:21:5

the rest of the code is available at https://github.com/peacefulfoundation/reasonable.diet/tree/feat/content/search/. can someone elaborate on the issue or anything i'm missing out on?

GitHub

(temporary site at). Contribute to peacefulfoundation/reasonable.diet development by creating an account on GitHub.

GitHub

(temporary site at). Contribute to peacefulfoundation/reasonable.diet development by creating an account on GitHub.

GitHub

(temporary site at). Contribute to peacefulfoundation/reasonable.diet development by creating an account on GitHub.

mental orioleBOT
#

Hi @olive vale. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. However, based on the error message you provided, it seems like you're passing invalid arguments to the <ArrowCard> component.

Astro components cannot be rendered manually via a function call, such as Component() or {items.map(Component)}. Instead, you should use the component syntax <Component /> or {items.map(item => <Component {...item} />)}. This might be the cause of the InvalidComponentArgs error you're encountering. source (https://docs.astro.build/en/reference/errors/invalid-component-args/#_top)

Also, ensure that any component you are importing and rendering is working correctly. This error can occur when trying to import or render an invalid component, or one that is not working properly. source (https://docs.astro.build/en/guides/troubleshooting/#expected-a-default-export)

If you're still having trouble, consider creating a minimal reproduction of the issue. This is a smaller, simplified Astro project that demonstrates your issue. Sharing a minimal reproduction is helpful when asking for help in support threads and is often required when filing a bug report to Astro. source (https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions)

Lastly, if you're using SolidJS with Astro, make sure you're familiar with how framework components are loaded, client-side hydration options, and opportunities to mix and nest frameworks together. source (https://docs.astro.build/en/guides/integrations-guide/solid-js/#getting-started)

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@olive vale kapa.ai is still learning and improving, please let us know how it did by reacting below