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
/home/ramanacv/work/getwise/momo/momo-be/dist/server.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/home/ramanacv/work/getwise/momo/momo-be/dist/server.js:5:37)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND', -->
Tried again and this time a different place but similar error as below -
/home/ramanacv/work/getwise/momo/nft-api-backend/dist/server.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/home/ramanacv/work/getwise/momo/nft-api-backend/dist/app.js:22:49)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/ramanacv/work/getwise/momo/nft-api-backend/dist/app.js',
'/home/ramanacv/work/getwise/momo/nft-api-backend/dist/server.js'
]
version is the latest one from master branch. Happens for default installation as well as any other options..
Works fine in dev mode - npm run dev...
The text was updated successfully, but these errors were encountered:
Line 5 and 6 are requireing modules without .ts suffix, but line 7 and onwards required module with .ts suffix. This is bound to fail because .ts files don't exist inside dist. Most likely, this is an swc config issue. I'll update here when I find a solution.
--
Update:
My issue was absolute paths. I had to run an additional command to convert absolute paths into relative paths.
I used the package tsc-alias. I also removed swc and used tsc to compile our codebase:
npm run start is failing with the following error message..
Successfully compiled: 27 files, copied 4 files with swc (53.37ms)
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './app.ts'
Require stack:
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/home/ramanacv/work/getwise/momo/momo-be/dist/server.js:5:37)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND', -->
Tried again and this time a different place but similar error as below -
Successfully compiled: 22 files, copied 2 files with swc (188.82ms)
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './middlewares/error.middleware.ts'
Require stack:
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/home/ramanacv/work/getwise/momo/nft-api-backend/dist/app.js:22:49)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/ramanacv/work/getwise/momo/nft-api-backend/dist/app.js',
'/home/ramanacv/work/getwise/momo/nft-api-backend/dist/server.js'
]
version is the latest one from master branch. Happens for default installation as well as any other options..
Works fine in dev mode - npm run dev...
The text was updated successfully, but these errors were encountered: