I have checked similar posts about the same error but still getting the same. The error states that the dist/
don’t have db/index.js
which it has. Need help with this. Thank you in advance.
Package.json
{
"name": "server",
"version": "1.0.0",
"description": "Pollution tracker to report Pollution incidents in nearby locations.",
"main": "index.ts",
"type": "module",
"scripts": {
"build": "npm install typescript && npx tsc && ls -l ./dist && ls -l ./dist/db",
"start": "node --es-module-specifier-resolution=node ./dist/index.js",
"dev": "nodemon index.ts"
},
....
}
Project structure
Github link → GitHub - Michle99/server
Errors
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/render/project/src/dist/db/index' imported from /opt/render/project/src/dist/index.js
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/render/project/src/dist/db/index'