Problem deploying node app on Heroku – build successful, but returns Error: Cannot find module ‘request’

I´m still experimenting with node and this modern architecture with javascript, react and so on. But I have a lot of experience with web development (PHP, ASP.NET). Anyway, I´m working on transcoding …

Express.js app times out when attempting to query a PostgreSQL database

I’ve built an Express.js app, hosted by Heroku, with a non-embedded PostgreSQL database. The app was running as intended until about a month ago, and for several months before that. However, when I …

Node.js: fs.existsSync doesn’t work on Heroku

I have a Heroku app using Node.js and Express, and I want to determine whether or not a certain file exists. However, it seems like the file is never found. I have the following path: app.get(‘/sims/:…

heroku and nodejs erorr (Web process failed to bind to $PORT within 60 seconds of launch)

I am using discord.js and I have a code where if someone votes for my bot on https://top.gg the bot will send a message, but it got this error Web process failed to bind to $PORT within 60 seconds of …

How to set Heroku Port for NodeJS Express App?

so I’m trying to host my website on Heroku and set up everything to get my app up and running. Whenever I try to submit the form I get undefined errors. Undefined Errors Console Errors I’ve set it up to use the port like shown in the documenation: When starting the app locally with heroku local web I get Typerror: Failed to Fetch and the undefined results but when I go into my .env file and add a port=8081 it works perfectly fine. Good result When I open it with heroku open I still have that undefined problem. I don’t

Optional chaining operator gives SyntaxError when building my application to Heroku but works on my machine

I am using the optional chaining operator in my application, for instance: (checks if optionalField exists, then do something with it) The above code works perfectly on my machine but it gives me an error when I try to build this code on Heroku. Here is what the logs say: Does anyone know why is that? I suspect I should compile the code first using Babel and then deploy to Heroku? Is it even related to Babel? Answer Does anyone know why is that? Locally you’re using a recent version of Node.js that supports the optional chaining operator. Apparently Heroku

Heroku custom DNS API route issue in Node.js

I have a custom domain set up in Heroku which works fine. I can access my site using both my app name and custom domain. I can access a route using my standard Heroku URL, but not using the custom …

cors-anywhere.herokuapp.com not working (503). What else can I try?

I am trying to send a get request to the Wikipedia API. I am sending the request form a angular frontend so i’m trying to use the Heroku CORS Anywhere endpoint to avoid CORS issues. For some reason, …

Heroku: “No default language could be detected for this app” error thrown for node app

I am learning NodeJS and the course I’m following has several projects, arranged by sections. I have all the projects under one main folder, which is also a git repository. Each of these subfolders …

Is it possible to override a local .npmrc when running `npm install`?

My project has an .npmrc located in its root, which contains the infamous ${NPM_TOKEN} hack and is required for CI, Staging, Production, etc. In order to work around this reality, I’d like for …