Debug with the console
When a request or script does not behave as expected, Fetchpier gives you a few places to look.
Log from scripts
Section titled “Log from scripts”Use fp.log, fp.warn, and fp.error (or console.log/warn/error) in either script phase. Output
appears in the scripts console of the response viewer. Logged values are deep-cloned to a safe
representation, so you can log whole objects without leaking live references or freezing on a circular
graph.
const body = fp.response.json();fp.log('response body', body);fp.warn('status', fp.response.status);Check the Tests tab
Section titled “Check the Tests tab”Assertions registered with fp.test show up in the Tests tab as pass/fail, with the error message
for failures. See Tests and assertions.
fp.test('status is 200', () => fp.expect(fp.response.status).to.equal(200));Watch for unresolved variables
Section titled “Watch for unresolved variables”If a {{variable}} is not defined, Fetchpier leaves it literal and flags it in the UI, but still sends
the request — so you can see exactly what went out. Check the resolved request in the
activity record to confirm what was actually sent.
Lean on the script editor
Section titled “Lean on the script editor”The pre/post script editors flag type errors, unused identifiers, and deprecated fp.* members
inline, and they will not autocomplete anything the sandbox would reject (no Promise, no
setTimeout, no DOM). If a completion does not appear, the sandbox does not support it.