Link to the Bus: https://github.com/LeoPlatform/bus
- Node.js 20+ (use
nvm use 20if you have nvm) - leo-cli installed globally for the same Node major you use to run bus-ui (many setups use Node 20 → leo-cli 4.x; public npm may still list
3.0.3-betaasbeta). Runwhich leo-cliandleo-cli --versionafternvm use 20. - The
--openssl-legacy-providerflag is required for webpack/babel on Node 20:NODE_OPTIONS=--openssl-legacy-provider bus=TestCup npm start
Do these in order; skip a step only if you are sure it already passes.
-
Use Node 20 and its global
leo-cli
nvm use 20(or equivalent). Confirm:node -v which leo-cli leo-cli --version
If
which leo-clipoints at another Node (e.g. v23), fixPATHso Node 20’s global bin is first. -
Repo + gitignored
test/
From the repo root you run (primary clone or worktree):npm install
If
test/only hasprocess.jsand you normally keep local config elsewhere, copy from your primary clone’stest/(or run the genie scriptscripts/bootstrap-bus-ui-worktree.shfrom the workspace root). -
test/process.jsforbus=TestCupTestCupentry must match the bus you use.- Set
Resources.CognitoIdto a real Cognito Identity Pool id (region:uuid) for that environment. - Ensure
views/indexincludes the fix that readsleo.Resources.CognitoId(not onlyleo.CognitoId) forwindow.leoAws.
-
OpenSSL legacy provider (required on Node 17+)
Without this, webpack can fail withdigital envelope routines::unsupported:export NODE_OPTIONS=--openssl-legacy-provider -
Start the app
export bus=TestCup # optional; `npm start` defaults to TestCup if unset npm start
npm startrunsscripts/start-local.js, which loadstest/process.jsintoprocess.envbeforeleo-cliso API bundles (e.g. stats) canrequire('leo-sdk')during Browserify without Missing kinesis, s3, firehose. Usenpm run start:rawonly if you intentionally bypass that (not recommended for local UI). Wait until you see webpackCompiled successfullyand a line likeRunning microservice(Leo_Botmon) on port 80(your port may differ).Live reload (JS/CSS): After saving a file, the browser should reload automatically once webpack finishes rebuilding. If it does not, see the troubleshooting row for HMR and optional polling.
-
Open the right URL
Default ishttp://localhost/module/(port 80 — not 3000). If port 80 bind fails on your Mac, check how yourleo-clichooses the port or run with the privileges your team uses for local Botmon. -
Verify HTML before debugging the UI
- View Page Source (not DevTools Elements).
- There must be no raw
${leo.CustomJS}/${leo.static.uri}text. - The first app script tag after
<body>must not besrc="undefined". - Optional:
curl -I "http://localhost/module/static/<version-from-source>/css/index.css"should be 200 andcontent-type: text/css(nottext/html).
-
AWS credentials
Configure a profile (or env vars) so the SDK can use Cognito and call Test APIs for the stack IDs inprocess.js.
After the UI loads and you can sign in:
- Open a queue (or system) dashboard → events / event search view.
- Expand or select a row so the action icons appear.
- Hover the CCW icon — tooltip should describe checkpoint reset and reprocess from here, not “replay” only.
- Click it → modal title Reprocess from this event, helper text, primary button Reset checkpoint & reprocess, and confirm dialog text should match the new copy.
| Symptom | Likely cause |
|---|---|
Cannot read properties of undefined (reading 'Region') in leoApiGateway.js |
window.leoAws.cognitoId is undefined. Set Resources.CognitoId in test/process.js to your environment’s Cognito Identity Pool id (region:uuid). Do not leave it unset for local UI. |
Refused to apply style … MIME type ('text/html') for …/static/…/css/index.css |
The static URL returned a 404 HTML page (wrong path or webpack didn’t emit assets). Confirm leo-cli test finished compiling; open the CSS URL in a new tab and check for 404. |
module/undefined script |
View page source: if you still see ${leo.CustomJS} literally, template substitution failed—fix webpack/leo-cli errors in the terminal. If CustomJS is the word undefined, the dev server didn’t inject the bundle URL. |
| Blank page after fixing the above | AWS credentials must allow Cognito + API calls for the chosen bus= environment. |
| Terminal shows “Compiled” but the browser never updates | HMR: leo-cli uses webpack-hot-middleware with reload=false; the app must call module.hot.accept() — bus-ui does this in ui/js/index.js (full page reload on change). If file saves don’t trigger rebuilds (Docker/NFS), add "webpackPoll": 1000 (milliseconds) next to other keys under package.json → config.leo so leo-cli passes polling to webpack’s watch options. |
npm run publish / npm run build fails with ERR_OSSL_EVP_UNSUPPORTED or digital envelope routines::unsupported |
Node’s OpenSSL 3 vs old webpack/babel. Use npm run publish / npm run build (they set --openssl-legacy-provider via scripts/publish-local.js / build-local.js), or export NODE_OPTIONS=--openssl-legacy-provider. publish:raw / build:raw skip that flag. |
module.exports = {
env: {
leoauthsdk: {
LeoAuth: "",
LeoAuthUser: "",
Region: ""
}
leosdk: {
LeoStream: "",
LeoCron: "",
LeoEvent: "",
LeoSettings: "",
LeoSystem: "",
LeoS3: "",
LeoKinesisStream: "",
LeoFirehoseStream: "",
Region: ""
},
Resources:{
LeoStats: "",
CognitoId: ""
},
StackName:""
}
}
let environments = {
prod: {
leoauthsdk: {
LeoAuth: "",
LeoAuthUser: "",
Region: "",
},
leosdk: {
LeoStream: "",
LeoCron: "",
LeoEvent: "",
LeoSettings: "",
LeoSystem: "",
LeoS3: "",
LeoKinesisStream: "",
LeoFirehoseStream: "",
Region: "",
},
Resources: {
LeoStats: ""
}
},
test: {
leosdk: {
Region: "",
LeoStream: "",
LeoCron: "",
LeoEvent: "",
LeoS3: "",
LeoKinesisStream: "",
LeoFirehoseStream: "",
LeoSettings: "",
LeoSystem: "",
},
leoauthsdk: {
LeoAuth: "",
LeoAuthUser: "",
Region: "",
},
Resources: {
LeoStats: ""
}
}
};
const config = environments[process.env.bus] || Object.values(environments)[0];
config.StackName = config.Resources.LeoStats.replace(/-LeoStats-.*$/, "");
// Do not assign CognitoId = "" here — it breaks local `LEOCognito.start` unless you use another auth path.
config.BusName = (config.leosdk.kinesis || config.leosdk.LeoKinesisStream).replace(/-LeoKinesisStream-.*$/, "");
module.exports = {
env: config
}
console.log(`Connecting to Bus: ${config.BusName}, Botmon: ${config.StackName}`);
Run npm run publish (wraps leo-cli with --openssl-legacy-provider, same as npm start, so webpack/babel work on Node 17+).
Optional tag for a custom S3 folder:
npm run publish -- --tag lynn_depUse npm run publish:raw only if you intentionally skip the OpenSSL flag (not recommended on Node 20).
Tip
Pass any extra leo-cli publish flags after -- as shown above.
This will output the name of an S3 file that you will need to copy
Then go into the Cloudformation web ui and find the correct stack you want to update (ProdBus, StagingBus, etc)