- Biome 2.6 Upgrade: Unknown Config Keys and New Lint Errors· 6 min read
Biome 2.6 upgrade from 2.3: fix the "unknown key useSortedClasses" and gritMetavariables errors, see which new lint errors show up, and turn off promoted rules.
- Playwright 1.64 and 1.65 Upgrade: Why Your Tests Fail Now· 8 min read
Playwright 1.65 upgrade fixes: element is inert timeouts, toBeVisible hidden in iframes, page object TypeError, screen 1920x1080, cookies [] and No tests found.
- Upgrade Vitest 2 to Vitest 5: Breaking Changes in the Order You Hit Them· 8 min read
Upgrade Vitest 2 to Vitest 5: fix ERESOLVE, removed config options, vi.mock inside describe, clearMocks, unawaited resolves, and the changes that fail silently.
- What's Inside a JWT and How to Decode It Locally· 6 min read
Decode a JWT with jq or Node.js, read the header and claims, convert exp to a date, and see why decoding doesn't verify it or make it safe to paste online.
- Fix @tailwindcss/oxide Native Binding Error in pnpm Workspace with Next.js· 4 min read
Getting 'Cannot find native binding' for @tailwindcss/oxide in a pnpm workspace with Next.js Turbopack? Here's why it happens and how to fix it.
- How to Trigger React Error Boundary (Dev and Test)· 4 min read
Trigger a React error boundary by throwing during render, testing the fallback in Jest, and using showBoundary for async or event-handler errors.
- Mock IntersectionObserver in Jest Setup· 5 min read
Fix "IntersectionObserver is not defined" in Jest with a global mock in jest.setup.ts, then trigger isIntersecting to test lazy loading and infinite scroll.
- Check If Clicked Element Is Descendant Close On Click Outside· 3 min read
Detect a click outside a modal or dropdown in React with Node.contains(), and close it by checking if the clicked element is a descendant.
- Enforce Named Functions in useEffect with ESLint· 2 min read
Arrow functions in useEffect show as 'Anonymous function' in stack traces. Enforce named effects with ESLint no-restricted-syntax and func-names in flat config.
- Fix "Property 'value' does not exist on type 'EventTarget'"· 3 min read
event.target is EventTarget because events bubble. Use ChangeEvent<T> for onChange, currentTarget for other React events, and instanceof for addEventListener.
- Fix useRef "Property does not exist on type 'never'"· 3 min read
useRef(null) types ref.current as null, so an if check narrows it to 'never'. Pass the element type with useRef<HTMLInputElement>(null), or JSDoc in .jsx.
- Fix Jest "window.matchMedia is not a function"· 3 min read
jsdom has no window.matchMedia, so Jest throws a TypeError. Add a plain-function mock to your setup file that survives resetMocks and can match specific queries.
- How to Handle CORS When Using json-server· 3 min read
Fix CORS errors with json-server 0.17: what it already enables, when to write a custom server.js, and why wildcards fail with credentials. Also v1 notes.
- 5 Examples of Applications for Learning JavaScript· 10 min read
Discover 5 simple applications to enhance your JavaScript skills. Dive deeper into learning by trying out these JavaScript examples today!
- Fixing Jest Error: 'Not Implemented window.scrollTo'· 2 min read
Fix "Not implemented: window.scrollTo" (or "Window's scrollTo() method" in jsdom 27+) in Jest or Vitest by mocking window.scrollTo in your setup file.
- Fix "ReferenceError: ResizeObserver is not defined" in Jest· 4 min read
Fix "ReferenceError: ResizeObserver is not defined" in Jest or Vitest with a setup-file mock, plus a version that fires the callback so you can test resized layouts.
- Testing Next.js Image Component· 3 min read
Test the Next.js Image component in Jest by mocking next/image as a plain img tag, then assert alt text and src. Includes a component test and common mistakes.
- Testing the next-i18next Library with Jest· 2 min read
Test components that use next-i18next in Jest by mocking useTranslation so t() returns the key. Includes a component test and a global Jest setup file.
- How to Resolve 'Cannot use import statement outside a module' Error when Mocking Swiper JS with Jest· 2 min read
Fix Jest's 'Cannot use import statement outside a module' error with Swiper by letting transformIgnorePatterns transform it, or mock Swiper in unit tests.
- Resolving Jest Error with EMFILE Too Many Open Files· 2 min read
Fix the Jest EMFILE too many open files error by lowering maxWorkers, ignoring build folders, raising ulimit, and running in band on CI.
- Comprehensive Guide: Mocking Next.js useRouter with Jest for Effective Testing· 2 min read
Mock Next.js useRouter in Jest to control pathname and query and assert router.push, with a dynamic route example and the App Router next/navigation variant.
- Setup Nodemon with Babel· 2 min read
Run a Node.js project with nodemon and Babel: install @babel/node and preset-env, add a .babelrc, and add a start script that reruns modern JavaScript on save.
- Webpack Configuration: Including Specific Moment.js Locale· 2 min read
Keep only the Moment.js locales you need in Webpack with ContextReplacementPlugin, so the bundle stops shipping every locale, and check the size drop.
- Debugging 'window.scrollTo' Invocation for Identifying the Caller· 1 min read
Find exactly where window.scrollTo is called in Jest tests using console.trace, jest.spyOn, and a few quick steps to narrow down the caller.