Import error when importing types in SvelteKit typescript app

Viewed 283

When trying to run my SvelteKit app I get the following error:

error: Expected "from" but found "{"

import type { ProductsListType } from '../types';

I have a types.ts file where I export my typescript types:

export type ProductType = { name: string; link: string; imgURL: string; alt: string };

And in my index.svelte I import the type:

<script context="module" lang="typescript">
    import type { ProductType } from '../types';
</script>

This error appeared from one day to another. I tried to revert my package updates but the error remained.

0 Answers
Related