NuxtN
Nuxt2w ago
lutejka

Vitual file not defined

I'm trying to create a virtual file within the nitro:config hook of my module using

addTemplate({
  filename: 'rpcMethodsTypes.mjs',
  getContents: () => `
  export default ${JSON.stringify(mappedRpcMethods, null, 2)} `,
})


However, when I try to import this file in a composable I always the error message Package import specifier is not defined when running the an app using this module.

I also tried addServerTemplate but I still get the same error. Am I missing something?
Was this page helpful?