Skip to content

Step 3 — Read the logs before you need them

About 15 minutes. Branch: step-3 (and step-3-broken).

The one new idea: build logs and deploy logs are two different places, and you should find out which is which while nothing is wrong.

This step breaks on purpose

You are going to deploy something that does not compile, watch it fail, and find out where the error is written down. Your site stays up the whole time — that is the point.

Break it

In frontend/src/Layout.jsx, add an import for a file that does not exist:

import { BUILT_AT } from "./buildInfo.js";

and use it in the footer:

<footer className="footer">Built on AppMecca · {BUILT_AT}</footer>

Push and deploy:

git commit -am "Add a build marker"
git push
mecca app redeploy tally -b tutorial

Watch it fail

mecca queue list

The build goes red. Open your site anyway — it is still there, still serving the previous version. A failed build never replaces a working deploy.

Now find out why:

mecca logs tally --type build -b tutorial

Near the end:

Could not resolve "./buildInfo.js" from "src/Layout.jsx"

That is the whole skill. The error is specific, it names the file and the line, and it was one command away.

The three log types

mecca logs tally --type build -b tutorial     # did the code compile?
mecca logs tally --type deploy -b tutorial    # did the platform ship it?
mecca logs tally --type container -b tutorial # what did the app print?

They answer different questions and you will reach for the wrong one at least once. A rule of thumb: if the version never went live, it is build or deploy. If it went live and misbehaves, it is container.

--type container is empty right now, and correctly so

Tally has no container yet. It is files on a CDN — there is no process printing anything. It fills up at step 6.

Useful narrowing, all of which compose:

mecca logs tally --since 1h --level error -b tutorial
mecca logs tally --search "resolve" -b tutorial

Fix it

Create the missing file:

frontend/src/buildInfo.js @ step-3
export const BUILT_AT = import.meta.env.MODE === "production" ? "release" : "dev";

Push, deploy, and the footer gains a marker.

Worth noticing what that value is: Vite replaces import.meta.env.MODE when the bundle is compiled. It is fixed at build time. Step 8 introduces values that are decided at deploy time instead, and the difference matters more than it looks.

If it didn't work

Symptom Try Usually
The build succeeded git log --oneline -1 on the remote The break was not pushed
--type build is empty mecca queue list The build has not started; there is nothing yet
Site went down It should not have. If it did, that is worth reporting

Reset to the reference

git fetch upstream && git reset --hard upstream/step-3 && git push --force origin tutorial

Next: Step 4 — Change something, and learn what the platform ignores