I'm encountering issues with my Laravel + Vite + Vue 3 project. I followed the installation instructions in the documentation and everything works fine when the project is separated from Laravel and Vite. However, I'm facing a problem where TypeScript doesn't recognize the export default, resulting in an error message like this:
MainLayout.vue:42
Uncaught SyntaxError: The requested module '/resources/scripts/composable/Auth.js' does not provide an export named 'default' (at MainLayout.vue:42:1)
Even though the Auth.ts file exports a function as shown below:
export default function useAuth(){
return {
CurrentUserToken: 'test';
};
}
This is how I've tried to call the function in some files:
import useAuth() from './Auth';
const { CurrentUserToken } = useAuth();
return CurrentUserToken;
I'm puzzled as to why it's unable to recognize this named function. Any insights on how to resolve this issue?