Create custom TypeScript types and make the available globally
Hello, as you can read in the Title I want to create custom TypeScript Types. In React I had a folder names "types" in the root Directory. And while I can do the same thing here and also import them, once I reload the Page I get
'/_nuxt/types/Message.ts' does not provide an export named 'Message'
is ther a way to fix this?25 Replies
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
How would I import that? Importing it like this:
import {Message} from '~/types/
doesn't work
But yes that did get me a step closer, now I just need to import itUnknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
This is my index.ts in /types/ https://paste.teamhelios.dev/7LnZ15X7n2 and unfortunately it doesn't auto import
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
With no import ahh okay, let me try
Ahh maybe its caused by me using it in defineProps?
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
not entirely sure I will try now
it does complain tho that I am using a type as a value tho
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
ReferenceError: Message is not defined
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
Take your time
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
That looks like it works π
Thanks alot!
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
that's fine π
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
Are you active on this Discord? in case I need other help
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
That would be awesome π
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View
Thanks alot! You were a great help
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View