NuxtN
Nuxtβ€’11mo ago
Mobyr

addImportsDir does work for types but doesn't work at runtime

I wanted that in my Nuxt module, the enums defined in the module are defined globally in the application, so I added "addImportsDir(resolve('./runtime/enums'))" in the setup function of defineNuxtModule, but although it works for types with typescript, in runtime I have errors like "ReferenceError: __unimport_MyEnum is not defined"
Was this page helpful?