NuxtN
Nuxt12mo ago
bnason

Server side dynamic import

Is there a way use
await import(....)
on the server side? I've tried importing the full path with and without the extension and both give errors. Using .ts says
unknown file extension .ts
and without ext, says
Cannot find module
. I tried using the relative path, IE
~~/server/utils/foo/bar
but that says
cannot find module ~~
. I'm not loading a nitro plugin or module, just a normal ts file with an export I'm checking for once loaded.
Was this page helpful?