I wanted to put my interface/type in a seperate file so I could import it later but for some reason I am getting this error:
Uncaught SyntaxError: The requested module '/src/types/settings.ts' does not provide an export named 'default'
Here is my types/settings.ts
interface Settings {
activeUserId: number
}
export default Settings
And here is how I import it:
import Settings from '@/types/settings'
Same error shows if I try to export a Type but it works fine if I export a Class. I can't understand what I am doing wrong here.
I am using Vue 3/Vite with Typescript.
Don't use default export.
Use the following instead.
// types/settings.ts
export interface Settings {
activeUserId: number
}
import { Settings } from '@/types/settings'