Vue typescript export module error
Vue version
3.2.39
Link to minimal reproduction
https://github.com/amm834/vue-supabase-workout-app/tree/cf722cadc965fe5d8f23a83b077eaca274f63afa
Steps to reproduce
Clone that repo and
See:
What is expected?
Error must be resolved.
What is actually happening?
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/@supabase_supabase-js.js?v=dfd7ae95' does not provide an export named 'Session' (at auth.ts:3:9)
System Info
System:
OS: Windows 10 10.0.22000
CPU: (4) x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
Memory: 1.08 GB / 7.66 GB
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (105.0.1343.42)
Internet Explorer: 11.0.22000.120
npmPackages:
vue: ^3.2.38 => 3.2.39
Any additional comments?
It seems vite and esbuild error. But I just decided to open that at here cuz you guy are same in fact
This is not related to Vue core. My recommendation would be to join the Vite discord and ask the Vite community how do deal with this error.
Sorry, I just forgot the typescript version and to check the vite doc. I just fixed that bug by using type-only import that was introduced in typescript version 3.8.
import type {Session} from "@supabase/supabase-js";