Passing props and undefined is not a constructor

Just wiring up basic props and getting an error.

In Component.svelte file:

    import { Foo } from './Foo.svelte'

   <Foo number={42}/>

In Foo.svelte:

   export let number;

Number is {number}

I get the following error in the console:

TypeError: undefined is not a constructor (evaluating 'new Foo({
    props: {
      number: 42
    $$inline: true

Wondering what I’m missing here. Thanks for any guidance!

Remove the brackets in the import, so:

import Foo from './Foo.svelte';

:pray:t2: Saved me so much time. Works now. Thank you for the help!!

1 Like