#tooling 28 articles
For license information please see … leads to a 404 — the publish step left the bundle's .LICENSE.txt behind gotchas / tooling webpack moves third-party license comments into .js.LICENSE.txt and leaves only a pointer in the bundle; a publish step that copies *.js, or an allowlist .gitignore, ships the code without the texts MIT and BSD… git rm -r leaves the directory behind, so a tool reading the filesystem reports a version nobody serves gotchas / tooling Untracked build leftovers keep a removed version folder alive on disk, so anything listing versions with readdirSync offers a build the site no longer serves; read published content from git ls-tree and fail closed… global.navigator = dom.window.navigator is ignored on Node 21+ (or throws) — your jsdom test runs with Node's navigator gotchas / tooling Node 21 added a global navigator that has a getter and no setter, so the classic hand-made jsdom setup line is silently ignored (strict mode throws a TypeError) and the test sees Node's userAgent (e.g. "Node.js/24")… process.exit() right after fetch() can crash Node on Windows, and the exit code then lies gotchas / tooling On Windows (seen on Node.js 24), process.exit() right after the built-in fetch() sometimes aborts on a libuv assertion (UV_HANDLE_CLOSING) and ends with a crash code (3221226505, shown as 127 in Git Bash), so a check… TextEncoder is not defined before your first test runs — a dependency needs it at import time and jsdom does not have it gotchas / tooling jsdom has no Encoding API and a dependency that builds new TextEncoder() at module level dies on import, before beforeAll; import a polyfill module first or use setupFiles, and make the dependency lazy A component from a linked package throws "Invalid hook call" in Jest — the test loaded a second copy of React gotchas / tooling Jest resolves a file:/junction package by its real path, so the package's require('react') finds a second copy; map react and react-dom to the app's copy (the SPFx build is unaffected — React is a platform component) A GitHub Pages CDN without .nojekyll freezes on its last good build gotchas / tooling Branch builds run Jekyll unless .nojekyll exists; a growing bundle host ended in a bare "Page build failed." while the site kept serving the old build — read /pages/builds before pushing again A literal NUL byte makes ripgrep treat a source file as binary — a silent blind spot for every grep-based sweep gotchas / tooling One raw U+0000 and every grep-based sweep silently skips the file; write the escape, detect with file A retention window computed from git history deletes the file you overwrite in place gotchas / tooling A stable loader keeps its add date and drifts out of "the last N releases"; protect by shape (no content hash), and remember the hard 1 GB Pages limit counts the published tree A syntax check under PowerShell 7 proves nothing about 5.1 gotchas / powershell The parser belongs to the engine hosting it; ternary/??/&& pass in 7 and are parse errors in 5.1, and #Requires never warns you at authoring time A test that plants a git hook without chmod passes on Windows and fails on Linux CI gotchas / tooling Git ignores a hook without the executable bit, but Git for Windows does not check that bit and runs a hook that starts with #!/bin/sh, so a fixture that writes .git/hooks/pre-commit with writeFileSync blocks the commit… An ECDSA signature made in Node fails crypto.subtle.verify in the browser — Node defaults to DER, WebCrypto expects raw r||s gotchas / tooling crypto.sign in Node returns a DER-encoded ECDSA signature (69–72 bytes); WebCrypto verify in an SPFx bundle expects IEEE P1363 (64 bytes for P-256) and just returns false. Sign with dsaEncoding ieee-p1363, check the… Azure TTS HD voices are generative — the same sentence gives a different recording each time, so verify every file by transcription gotchas / tooling DragonHD output varies per call and sometimes garbles a term; transcribe each MP3 with fast transcription and regenerate on a miss. Use for a non-native language, playbackRate instead of the unsupported , and honor… Compiled files sitting next to sources fake your build verification gotchas / tooling Stale .js/.d.ts in src/ greps like live code while main points at lib/; ask require.resolve, date-check with git log, and keep the ignore rule narrow enough to spare hand-written .d.ts Console scripts on SharePoint hang because the ODSP service worker stalls every fetch gotchas / tooling A SharePoint page is controlled by the odspserviceworkerproxy.aspx service worker; when it gets stuck, every fetch from the page (even to another domain) never resolves while timers still run – a hard reload (Shift+F5)… Diagnostics that cannot survive the crash they are diagnosing gotchas / tooling Frozen threads stop repainting, sessionStorage dies with the tab and the next healthy run overwrites the crash report; persist synchronously and never gate recovery on a flag Driving an SPFx page from the console — two traps that fake success gotchas / tooling input.value from the console leaves React state empty (use the native setter + input event) and window.confirm freezes CDP automation; both fail silently as success Getting bulk data into a SharePoint page from the console — a localhost server beats pasting, and beats uploading it somewhere gotchas / tooling Serve the payload from 127.0.0.1 with CORS instead of pasting it or uploading it; loopback is a trustworthy origin so HTTPS pages may fetch it – and when Chrome local network access blocks it ("Failed to fetch"), feed… Git Bash on Windows mangles backslashes passed to native tools — regexes silently stop matching gotchas / tooling [\\\\/] arrives as [/]; Windows-path regexes silently under-match GitHub Pages HTTPS certificate never arrives when the domain was added before DNS existed gotchas / tooling Domain added before DNS existed; remove & re-add restarts provisioning Jest's 5-second default timeout fails render tests under load, and the timed-out test breaks the next one gotchas / tooling The first jsdom + React test of a suite pays for the cold module load; on a busy build machine it passes 5 s, Jest abandons it while its async render keeps running, and the following test fails with "button not found"… Performance measurements taken in a hidden browser tab are worthless — and they look like a freeze gotchas / tooling Hidden tabs never fire requestAnimationFrame and clamp setTimeout to ~1/s, so the run times out and looks like the very freeze you were chasing (and the code under test never ran either); CSS transitions never advance… Root site swap refuses hub sites, and any site Publishing ever touched gotchas / tooling Invoke-SPOSiteSwap rejects a source or target that is a hub site or associated with one, and rejects a source where the Publishing feature was ever activated — not just currently; unregistering a hub leaves children… Setting process.env.TZ inside Jest does not change the time zone gotchas / tooling A test, setupFiles and setupFilesAfterEnv write into the sandbox's copy of process.env, so day-boundary tests pass only on machines already in the right zone; pin it in globalSetup, assert the offset, and run once… SPFx MSGraphClient calls don't show in DevTools Network — and how to diagnose them anyway gotchas / graph SPFx Graph traffic invisible in Network; diagnose via performance entries, currentuser, DOM, user's response The Contributors panel keeps a co-author you removed from history gotchas / tooling Panel and API answer different questions (co-authors vs authors), so verify at the source; know the documented ~24 h window before you start waiting Windows PowerShell 5.1 Get-Content/Set-Content mangles UTF-8 — á becomes á gotchas / powershell ANSI default double-encodes diacritics; non-ASCII in the pattern makes -replace match nothing and exit 1. Use System.IO.File + BOM-less UTF8Encoding, check git status after a failed run Word's PDF export silently substitutes your fonts — print to PDF instead gotchas / tooling ExportAsFixedFormat lays the text out in Calibri while Word still lists and embeds the font; print to PDF instead, install static (not variable) instances, and verify via the name table inside the embedded FontFile2