You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That would require the file to be existing, which, if I understand OP correctly, is not the case.
Normally you would create a declaration file and provide the types there, but it does not seem to work with a leading / character (and I don't know why). For an import from icons.json instead of /icons.json it works fine.
π Search Terms
json import module type
β Viability Checklist
β Suggestion
Allow specifying the type of dynamically created and imported JSON files with
.d.ts
files.π Motivating Example
This is a type error when
/icons.json
doesn't exist statically. There's no way to give it a type currently.π» Use Cases
Give
/icons.json
a type when imported though it's dynamically generated./icons.json
doesn't have a type, and is a type error.Using
fetch
with a then-generic-type.The text was updated successfully, but these errors were encountered: