How I Use Playwright to Catch Broken Routes Before Deploying
Throughout the past month, I’ve been building a free guitar-learning site with interactive tools and blogs among other things. At present, it has hundreds of routes, and I needed something to test the pages before deploying.
So I added a small Playwright workflow. It checks every route in the sitemap, opens some pages in a browser, and runs after the production build to catch any issues.
I think I’d need more than 7 tests to claim it catches all issues, but it’s quite useful for obvious deployment issues.
Why I decided to add Playwright
Generated 22 documents in .contentlayer✓ Creating an optimized production build✓ Compiled successfully✓ Collecting page data✓ Generating static pages (284/284)Build error occurredError: ENOENT: no such file or directory, rename'C:\Users\pc\Code\tonerune\.next\export\newsletter\2026-q3.html'-> 'C:\Users\pc\Code\tonerune\.next\server\pages\newsletter\2026-q3.html'
I was greeted by this interesting build failure. Hmm.. the route was generating both original slug and lowercase version.
The dynamic route was also deliberately generating both...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE