Unable to import local files inside of blitz console.
Paste all your error logs here:
While importing files via dynamic import
Uncaught Error: Cannot find package 'app' imported from C:\code\noble\noble\repl
Did you mean to import app/lib/dbUtils.ts?
at new NodeError (node:internal/errors:372:5)
at packageResolve (node:internal/modules/esm/resolve:954:9)
at moduleResolve (node:internal/modules/esm/resolve:1003:20)
at defaultResolve (node:internal/modules/esm/resolve:1218:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
at ESMLoader.import (node:internal/modules/esm/loader:380:22)
at importModuleDynamically (node:repl:503:47)
at importModuleDynamicallyWrapper (node:internal/vm/module:437:21)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
code: 'ERR_MODULE_NOT_FOUND'
}
While importing files via relative path
Uncaught:
TypeError: Unknown file extension ".ts" for C:\code\noble\noble\app\lib\dbUtils.ts
at importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
at ESMLoader.import (node:internal/modules/esm/loader:385:24)
at async Promise.all (index 0)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runMicrotasks (<anonymous>)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:304:34)
at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:345:17)
at new ModuleJob (node:internal/modules/esm/module_job:66:26)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:326:22)
at ESMLoader.load (node:internal/modules/esm/loader:407:26)
at defaultLoad (node:internal/modules/esm/load:21:20)
at defaultGetFormat (node:internal/modules/esm/get_format:118:38)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:76:11)
at new NodeError (node:internal/errors:372:5)
at __node_internal_captureLargerStackTrace (node:internal/errors:465:5) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Paste all relevant code snippets here:
Import files via dynamic path
app = import("app/lib/dbUtils.ts")
Import files via relative path
app = import("./app/lib/dbUtils.ts")
What are detailed steps to reproduce this?
Run blitz console.
Paste the above code snippets to import local TS files in the console.
What is the problem?
Unable to import local files inside of
blitz console
.Paste all your error logs here:
While importing files via dynamic import
While importing files via relative path
Paste all relevant code snippets here:
Import files via dynamic path
Import files via relative path
What are detailed steps to reproduce this?
blitz console
.Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response