I’m having an issue when bundling the Bun app. It uses Hono and WebSockets and runs perfectly on the dev runtime, but I’m having a problem running it after i build it with un build. I get the error message: Cannot find module "./lib/decorators/timed" from "/Users/b/codebases/az/mdlr/api/.api/index.js"
Here is my package-json:
{
"scripts": {
"api:local": "dotenv -e .env.local -- bun run --hot --watch index.ts",
"api:prod": "dotenv -e .env.prod -- bun run --hot index.ts",
"api:build": "dotenv -e .env.local -- bun build index.ts --outdir .api --target bun",
"api:start": "bun run .api/index.js",
"api:tsc": "tsc",
"api:lint": "eslint . --ext .ts,.tsx",
"api:lint:fix": "eslint . --ext .ts,.tsx --fix",
"api:unimported": "unimported",
"api:knip": "knip"
},
"dependencies": {
"cheerio": "^1.0.0-rc.12",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"firebase-admin": "^11.11.1",
"hono": "^4.3.4",
"moment": "^2.30.1",
"mongoose": "^8.3.4",
"slack-node": "^0.1.8",
"stripe": "^14.23.0",
"xml2js": "^0.6.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/bun": "^1.1.3",
"@types/slack-node": "^0.1.7",
"@types/stripe": "^8.0.417",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"dotenv-cli": "^4.0.0",
"knip": "^5.16.0",
"unimported": "^1.31.1"
}
}
- I tried to clean everything and bun install packages
- I tried to change folder name or similar experiments