Categories
Mastering Development

Using VSCode Debugger for Jest Tests throws error “SyntaxError: Cannot use import statement outside a module”

I have tried so many things, that i might just be making it worse at this stage. There are a lot of related questions, but nothing fixes my issue. I am obviously doing something wrong. I want to use VSCode debugger with my Jest Tests. I had this working when I was using require & […]

Categories
Mastering Development

Hosting Discord Bot through Heroku, EADDRINUSE error repeating after trying previous suggestions

I’m trying to host a Discord bot for the first time through Heroku (also my first time using the site). It was running perfectly locally, but I started receiving errors in regards to the $PORT once I went online. When I looked that up, I saw I needed to listen to the server in order […]

Categories
Mastering Development

Typescript Http.Post or Fetch in Express.js app

I’m new at Typescript and I’m trying to make an OAuth2 service like I’ve done in an Express.js normal app. But I’m not able to make a simple POST request with Typescript. All the examples I’ve found say I have to use "fetch", but when I do it I get an error saying fetch is […]

Categories
Mastering Development

.exe shows nothing after using electron-packager

When I use npm start (with "start": electron .") app works great. When I use .exe after packaging app with "start": "electron-packager ." it shows me nothing. Nothing at all. This is frustrating because when I go into app/resources/app folder I can run it just fine through index.html. Except files used by electron (init.js, package.json, […]

Categories
Mastering Development

‘MONGO_USER’ is not recognized as an internal or external command, operable program or batch file

I’m following NodeJS Tutorial on Udemy I got the error when I tried this code { "name": "nodejs-complete-guide", "version": "1.0.0", "description": "Complete Node.js Guide", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "MONGO_USER=MonkeyKing MONGO_PASSWORD=loveguitar4ever MONGO_DEFAULT_DATABASE=message STRIPE_KEY=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 node app.js", "start-server": "node app.js", "start:dev": "nodemon app.js" }, "author": "MonkeyKing", "license": "ISC", […]

Categories
Mastering Development

Node, Express API App on Azure giving Container Start Failure error

I have an existing Node and Express API application which I am trying to deploy to Azure WebApps. Deployment goes fine. But when I try to access the APIs, nothing happens. When I check log, I see following: "Container chdemoapi_0_f2df43ac didn’t respond to HTTP pings on port: 8080, failing site start""Container chdemoapi_0_4e583132 didn’t respond to HTTP […]

Categories
Mastering Development

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of laun

Hi I just followed up the code from Udemy class but I got a problem when I opened Heroku. I am a newbie here I hope anybody can help me out Index.js const express = require(‘express’); const app = express(); app.get(‘/’, (req, res) => { res.send({ hi: ‘there’ }); }); const PORT = process.env.PORT || […]

Categories
Mastering Development

reactjs application – can’t get my hello world to show up

Background / Problem I’m trying to build understand my first react/webpack/nodejs app. I am able to build / launch it by opening a browser and navigating to http://localhost:3333/ , but the hello world message I’m expecting is not showing. Instead I think it’s trying to give me a directory listing of a folder…? Not too […]

Categories
Mastering Development

How to fix Next.js Vercel deployment module not found error

My next.js app works on my machine and was working when deployed on Vercel but now it fails when building on Vercel with the following error: I’ve tried deleting node_modules and running npm install a few times but with no joy. Any help would be hugely appreciated. Thank you! Analyzing source code… 21:30:52.642 Installing build […]

Categories
Mastering Development

Keep getting stuck while setting up npm on windows

I am currently working my way through a course on UDEMY and we’re setting up nodejs and npm. I have started over from scratch 4 times now and I keep getting stuck at the same point. I will try and explain to the best of my abilities but I’m still learning so I hope I […]