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
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1088119372448542812/Bildschirmfoto_2023-03-22_um_16.17.45.png)
Unknown Userβ’2y ago
Message Not Public
Sign In & Join Server To View