Heroku build failing without any error NODEJS-TYPESCRIPT

Trying to push to heroku, but build fails without giving me any clue on what happened.

➜  bot-telegram-expense git:(master) ✗ git push heroku
Enumerating objects: 420, done.
Counting objects: 100% (420/420), done.
Delta compression using up to 12 threads
Compressing objects: 100% (408/408), done.
Writing objects: 100% (420/420), 373.00 KiB | 7.17 MiB/s, done.
Total 420 (delta 261), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (261/261), done.
remote: Updated 45 paths from 9dd5f29
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-22 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):   20.x
remote:        engines.npm (package.json):    10.x
remote:        
remote:        Resolving node version 20.x...
remote:        Downloading and installing node 20.13.1...
remote:        Bootstrapping npm 10.x (replacing 10.5.2)...
remote:        npm 10.7.0 installed
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules
remote:        
remote:        added 502 packages, and audited 503 packages in 8s
remote:        
remote:        62 packages are looking for funding
remote:          run `npm fund` for details
remote:        
remote:        5 vulnerabilities (2 low, 2 moderate, 1 critical)
remote:        
remote:        To address issues that do not require attention, run:
remote:          npm audit fix
remote:        
remote:        Some issues need review, and may require choosing
remote:        a different dependency.
remote:        
remote:        Run `npm audit` for details.
remote:        
remote: -----> Build
remote:        Detected both "build" and "heroku-postbuild" scripts
remote:        Running heroku-postbuild
remote:        
remote:        > [email protected] heroku-postbuild
remote:        > npm run build
remote:        
remote:        
remote:        > [email protected] build
remote:        > tsc
remote:        
remote:        Version 5.4.5
remote:        tsc: The TypeScript Compiler - Version 5.4.5
remote:        
remote:        COMMON COMMANDS
remote:        
remote:          tsc
remote:          Compiles the current project (tsconfig.json in the working directory.)
remote:        
remote:          tsc app.ts util.ts
remote:          Ignoring tsconfig.json, compiles the specified files with default compiler options.
remote:        
remote:          tsc -b
remote:          Build a composite project in the working directory.
remote:        
remote:          tsc --init
remote:          Creates a tsconfig.json with the recommended settings in the working directory.
remote:        
remote:          tsc -p ./path/to/tsconfig.json
remote:          Compiles the TypeScript project located at the specified path.
remote:        
remote:          tsc --help --all
remote:          An expanded version of this information, showing all possible compiler options
remote:        
remote:          tsc --noEmit
remote:          tsc --target esnext
remote:          Compiles the current project, with additional settings.
remote:        
remote:        COMMAND LINE FLAGS
remote:        
remote:        --help, -h
remote:        Print this message.
remote:        
remote:        --watch, -w
remote:        Watch input files.
remote:        
remote:        --all
remote:        Show all compiler options.
remote:        
remote:        --version, -v
remote:        Print the compiler's version.
remote:        
remote:        --init
remote:        Initializes a TypeScript project and creates a tsconfig.json file.
remote:        
remote:        --project, -p
remote:        Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.
remote:        
remote:        --build, -b
remote:        Build one or more projects and their dependencies, if out of date
remote:        
remote:        --showConfig
remote:        Print the final configuration instead of building.
remote:        
remote:        COMMON COMPILER OPTIONS
remote:        
remote:        --pretty
remote:        Enable color and formatting in TypeScript's output to make compiler errors easier to read.
remote:        type: boolean
remote:        default: true
remote:        
remote:        --declaration, -d
remote:        Generate .d.ts files from TypeScript and JavaScript files in your project.
remote:        type: boolean
remote:        default: `false`, unless `composite` is set
remote:        
remote:        --declarationMap
remote:        Create sourcemaps for d.ts files.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --emitDeclarationOnly
remote:        Only output d.ts files and not JavaScript files.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --sourceMap
remote:        Create source map files for emitted JavaScript files.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --target, -t
remote:        Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
remote:        one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
remote:        default: es5
remote:        
remote:        --module, -m
remote:        Specify what module code is generated.
remote:        one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, nodenext, preserve
remote:        default: undefined
remote:        
remote:        --lib
remote:        Specify a set of bundled library declaration files that describe the target runtime environment.
remote:        one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, dom.asynciterable, webworker, webworker.importscripts, webworker.iterable, webworker.asynciterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection, esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, esnext.object, decorators, decorators.legacy
remote:        default: undefined
remote:        
remote:        --allowJs
remote:        Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --checkJs
remote:        Enable error reporting in type-checked JavaScript files.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --jsx
remote:        Specify what JSX code is generated.
remote:        one of: preserve, react, react-native, react-jsx, react-jsxdev
remote:        default: undefined
remote:        
remote:        --outFile
remote:        Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output.
remote:        
remote:        --outDir
remote:        Specify an output folder for all emitted files.
remote:        
remote:        --removeComments
remote:        Disable emitting comments.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --noEmit
remote:        Disable emitting files from a compilation.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --strict
remote:        Enable all strict type-checking options.
remote:        type: boolean
remote:        default: false
remote:        
remote:        --types
remote:        Specify type package names to be included without being referenced in a source file.
remote:        
remote:        --esModuleInterop
remote:        Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility.
remote:        type: boolean
remote:        default: false
remote:        
remote:        You can learn about all of the compiler options at https://aka.ms/tsc
remote:        
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        If you're stuck, please submit a ticket so we can help:
remote:        https://help.heroku.com/
remote:        
remote:        Love,
remote:        Heroku
remote:        
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to bot-telegram-ai.
remote: 
To https://git.heroku.com/bot-telegram-ai.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/bot-telegram-ai.git'

I did everything I could. Is VITE the issue maybe?

Here is my package.json:


{
  "name": "xxxxxx",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "engines": {
    "node": "20.x",
    "npm": "10.x"
  },
  "scripts": {
    "dev": "vite",
    "heroku-postbuild": "npm run build",
    "build": "tsc",
    "preview": "vite preview",
    "start": "node dist/app.js"
  },
  "devDependencies": {
    "@types/cors": "^2.8.17",
    "@types/express": "^4.17.21",
    "@types/file-saver": "^2.0.7",
    "@types/node": "^20.12.10",
    "@types/request": "^2.48.12",
    "typescript": "^5.2.2",
    "vite": "^5.2.0",
    "vite-plugin-vercel": "^6.0.1"
  },
  "dependencies": {
    "@google/generative-ai": "^0.10.0",
    "@grammyjs/conversations": "^1.2.0",
    "@grammyjs/menu": "^1.2.1",
    "@grammyjs/ratelimiter": "^1.2.0",
    "@grammyjs/storage-free": "^2.4.2",
    "@vercel/node": "^3.0.1",
    "axios": "^1.6.8",
    "cors": "^2.8.5",
    "dotenv": "^16.4.5",
    "express": "^4.19.2",
    "file-saver": "^2.0.5",
    "grammy": "^1.22.4",
    "inngest": "^3.19.1",
    "inngest-cli": "^0.28.0",
    "openai": "^4.40.2",
    "request": "^2.88.2",
    "rollup-plugin-node-polyfills": "^0.2.1",
    "safe-eval": "^0.4.1",
    "vite-plugin-node-polyfills": "^0.21.0"
  }
}

Any suggestion is appreciated

Setting node version so far.
I run heroku local web and works perfectly.
Tried also to replicate the build process of heroku, so compiling with tsc and the running node/app.js

New contributor

Maiku is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật