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
For some reason importing a ts file dynamically using no file extension (which does work in the rest of the codebase thanks to vite-plugin-dynamic-import) requests exactly that file without transpiling it:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module './dynamictsfile' imported from index.bundled_t18m7musuj.mjs
at finalizeResolution (node:internal/modules/esm/resolve:260:11)
at moduleResolve (node:internal/modules/esm/resolve:920:10)
at defaultResolve (node:internal/modules/esm/resolve:1119:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
at ModuleLoader.import (node:internal/modules/esm/loader:474:34)
at defaultImportModuleDynamicallyForModule (node:internal/modules/esm/utils:214:31)
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:253:12)
And adding the file-extension to adhere to the vite standard (relative, no alias, file-extension) vite/features#dynamic-import
Unhandled Rejection at: Promise {
<rejected> TypeError: (intermediate value).glob is not a
function
reason: TypeError: (intermediate value).glob is not a function
So glob is probably not available in this stage of the compilation process / inside the compile-time context.
I hope I didn't miss something obvious & you can provide some assistance on resolving this issue.
If you need any more info I'd be happy to provide anything you need.
Thanks for your time & this awesome project!
The text was updated successfully, but these errors were encountered:
Works as expected
Dynamically importing TypeScript works just fine:
Dynamically importing JS with a variable also works just fine:
Unexpected behaviour
For some reason importing a ts file dynamically using no file extension (which does work in the rest of the codebase thanks to vite-plugin-dynamic-import) requests exactly that file without transpiling it:
It throws:
And adding the file-extension to adhere to the vite standard (relative, no alias, file-extension) vite/features#dynamic-import
results in forwarding it to esm without transpilation:
Using glob import vite/features#glob-import
results in:
So glob is probably not available in this stage of the compilation process / inside the compile-time context.
I hope I didn't miss something obvious & you can provide some assistance on resolving this issue.
If you need any more info I'd be happy to provide anything you need.
Thanks for your time & this awesome project!
The text was updated successfully, but these errors were encountered: