Deployment Rendering: Markdown and PCN Claim Tags
When deploying to Azure App Service (or similar), you may see nested markdown bullets lose indentation or PCN claim tags not rendering. This document explains causes and fixes.
1. Streamdown package
Streamdown renders markdown (including raw HTML like <claim>). If it is missing or not bundled, responses and PCN claims will not render correctly.
In this repo:
streamdownis independenciesinfrontend/package.jsonstreamdownis intranspilePackagesinfrontend/next.config.ts
In your deployment:
- Run
pnpm installbeforepnpm buildsonode_modules/streamdownexists. - If using standalone output, verify:
ls .next/standalone/node_modules/streamdown - If the app fails to load Streamdown, check DevTools Console for "streamdown" or "Cannot find module" errors.
2. Nested list indentation
Cause: Tailwind v4 picks up list classes from streamdown via @source '../node_modules/streamdown/dist/index.js' in frontend/app/globals.css. If that path does not resolve during the build, list styling breaks.
Fixes:
- Run the build from the directory that contains
app/andnode_modules/(the frontend root). - Install dependencies before the build.
- For pnpm, use
node-linker=hoistedorshamefully-hoist=truein.npmrcif Tailwind cannot resolve streamdown. - Set
STREAMDOWN_DIST_PATHto the absolute path tostreamdown/dist/index.jsif the build runs from a different directory.
Verify after build:
pnpm build
grep -l 'list-outside' .next/static/chunks/*.css
If you get a match, Tailwind saw streamdown. If not, re-check the steps above.
3. PCN claim tag not rendering
Cause: The <claim> tag is raw HTML rendered by Streamdown with ClaimMarkStreamdown from @pcn-js/ui. If it disappears in production, the tag may be stripped or the component may not run correctly.
Checks:
- Confirm the API returns
<claim>— Inspect the network response for chat messages; thepartsshould contain the literal<claim id="..." ...>...</claim>string. - Check the browser console — Look for React errors or mentions of "claim", "ClaimMark", "pcn", or "ClaimsProvider".
- Confirm the chat route uses the correct layout —
Data360ClaimsProvidermust wrap the chat (inapp/(chat)/layout.tsx). If the deployed app serves chat at a different path, the provider may not wrap it. - Sanitization / WAF — If a WAF or proxy sanitizes HTML, allow the
<claim>tag and its attributes.
Summary
| Issue | Fix |
|---|---|
| Nested bullets align left | Build from frontend dir, install deps first, use pnpm hoisting if needed |
| Claim tag missing | Confirm API returns <claim>, check console, allow tag through sanitization |