This repo contains my code from following the Udemy course Serverless Framework Bootcamp: Node.js, AWS & Microservices.
Since the course is now outdated (tools, APIs, and AWS policies have changed significantly), I made adjustments and workarounds to keep the project running in 2025.
You can see the list of changes below - this may be useful for fellow students or anyone revisiting the course.
Note
For the original unmodified source code, see the instructor's repos:
- General Notes
- Unit Specific Changes & Workarounds
As of Node v22 (and earlier versions that support it), using the default file structure causes an Internal Server Error due to a module syntax mismatch:
{
"errorType": "Runtime.UserCodeSyntaxError",
"errorMessage": "SyntaxError: Cannot use import statement outside a module"
}Rename all primary JavaScript files (Lambda handlers) from .js to .mjs. This explicitly tells Node.js to interpret them as modules.
The standard command-line syntax shown in the course may fail on Windows terminals. I used the following syntax:
Deploy entire stack:
sls deploy --verboseDeploy only one function:
sls deploy function -f createAuction --verboseListen to function logs:
sls logs -f processAuctions --tailInvoke function manually:
sls invoke -f processAuctions --logRemove Stack:
sls remove --verboseNote
Ensure you're executing the commands in a Command Prompt (cmd) rather than the default PowerShell terminal in VS Code.
When creating the template using:
sls create --name YOUR_PROJECT_NAME --template-url https://github.com/codingly-io/sls-baseI got an error - โ No configuration file found. Looking it up online I stumbled across a stackoverflow suggestion that suggested downgrading the Serverless installation:
npm i serverless@3.39.0 -g
This section caused a lot of problems on my end. The solution to all of them was just to downgrade middy to the versions mentioned in this question: I'm getting an error when calling getAuctions
npm install @middy/core@1.2.0 @middy/http-error-handler@1.2.0 @middy/http-event-normalizer@1.2.0 @middy/http-json-body-parser@1.2.0 @middy/validator@1.2.0I couldn't get the teacher's curl code to work for me (can't tell if it's because it changed or because I'm on Windows), but the following did the trick:
curl --request POST --url https://YOUR_AUTH0_DOMAIN/oauth/token --header "content-type: application/json" --data "{ \"client_id\": \"YOUR_AUTH0_CLIENT_ID\", \"client_secret\": \"YOUR_CLIENT_SECRET\", \"audience\": \"https://YOUR_AUTH0_DOMAIN.com/api/v2/\", \"username\": \"YOUR_USERNAME\", \"password\": \"YOUR_PASSWORD\", \"grant_type\": \"password\", \"scope\": \"openid\" }"Additionally, at some point I got the error:
Connection must be enabled for this client to perform single user creation and signup operations
The fix was making sure my application settings were correct, using the example in this question: Invalid connection name Username-Password-Authentication. The connection does not exist.
Lastly, if you check your token on jwt.io and you're not seeing an email in the decoded payload, make sure you copied the id_token and not access_token.
Deploying the Auth Service doesn't work as it did during the course's recording, a few changes need to be made to deploy auth-service.
I changed auth-service/serverless.yml from:
service:
name: auth-service
plugins:
- serverless-bundle
provider:
name: aws
runtime: nodejs12.xTo:
service: auth-service
provider:
name: aws
runtime: nodejs20.xAnd it did the trick. If you're still getting an error, try deleting node_modules and running npm i again.
Amazon SES changed quite a bit since the course was recorded. Instead of a Email Addresses, you need to go to:
- Identities (under Configuration).
- Click
Create Identity. - Select
Email address. - Enter your Email address.
- Click
Create Identity.
Now you can check your email for the verification email.
I got an error when trying to deploy the Bucket setup - CREATE_FAILED: AuctionsBucketPolicy.
The new default configuration for creating S3 Bucket Policies blocks public access, so the AuctionsBucket.yml needs to be updated from:
AuctionsBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.AuctionsBucket.name}To:
AuctionsBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.AuctionsBucket.name}
#[Make bucket public]
PublicAccessBlockConfiguration:
BlockPublicAcls: false
BlockPublicPolicy: false
IgnorePublicAcls: false
RestrictPublicBuckets: falseI kept getting image contains errors when trying to view my uploaded image using the URL - uploading a .jpg fixed the problem.
The strings I got from the teacher's encoder didn't end with = so I couldn't use a plain pattern: "=$".
Instead I found this useful question: Base64 Validation, providing a proper Base64 validation.
The frontend demanded a lot of troubleshooting on my end, since close to all dependencies included are outdated.
The initial npm install failed due to the obsolete node-sass package and severe dependency conflicts (especially with mobx-react and React Hooks). The solution was a multi-step cleanup and update.
- Remove obsolete package:
npm uninstall node-sass- Install replacement and a missing package that would cause an error later on:
npm install sass
npm install @material-ui/styles@4.11.5 --legacy-peer-deps- Update
package.jsonto these versions to fix the Invalid Hook error caused byuseStyles():
"mobx": "^6.9.0",
"mobx-react": "^9.1.0",
"react": "16.14.0",
"react-dom": "16.14.0",- Final cleanup:
- Delete
package-lock.jsonandnode_modules. - Run:
npm install --legacy-peer-deps
npm dedupeRunning npm start also threw an error. The fix to this was changing the package.json scripts to the following:
"start": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-app-rewired start",And installing:
npm install cross-env --save-devNow you can run npm start.
If the app opens but never gives you the login modal and crashes instead, make sure your Auth0 configuration is correct:
- You copied the
Client IDfrom the Default App and not the sls app. - The
Domainis correct (no extrahttps://or anything like that). - In the Default App settings,
Application Typeis set toSingle Page Application. - The Default App settings have
http://localhost:3000at all the places where the sls app has them.
To enable logging in with email (I had it off for some reason), head to:
- Authentication ->
Database. - Click the database.
- Applications tab -> Make sure
Default Appis enabled.
The final boss of all errors.
In short, mobx's inject & observer pattern was completely broken and failed to re-render the page on store changes.
I managed to get AuctionsPage.js to show the auctions by implementing a local React state to manually trigger a re-render after the data fetch:
import React, { useEffect, useState } from "react";
//...
const AuctionsPage = (props) => {
const { auctionStore, authStore, routerHistory } = props;
const [auctions, setAuctions] = useState([]); //for forcing re-renders
const classes = useStyles();
useEffect(() => {
(async () => {
await auctionStore.fetchAuctions(auctionStore.auctions);
setAuctions(auctionStore.auctions); //re-render the page
setInterval(() => {
//...
const renderAuctions = () => {
//const { auctions } = auctionStore; //using state instead
if (!auctions?.length) {But even after many hours of troubleshooting I couldn't get the Bid button to work. BidModal.js never re-renders, likely because it also relies on the broken MobX observer pattern.
I hit the limit of time for frontend debugging. This is where I stop.
- Login & registration work.
- App displays auctions.
- Creating an auction works. (including uploading an image!)
- Bidding on an auction doesn't work.