Troubleshooting
This guide covers common issues and solutions for test failures, build errors, performance regressions, and development environment problems.
Test Failures
Unit Test Timing Issues
- Symptom - Tests fail intermittently or when accessing element properties
- Cause - Component not fully rendered or updated before assertions
- Solution - Always wait for
elementIsStable()before assertions
Missing Fixture Cleanup
- Symptom - Tests pass individually but fail when run together
- Cause: DOM pollution from previous tests
- Solution - Always use
removeFixture()inafterEach()
Event Timing Problems
- Symptom - Event listeners don't trigger or receive wrong values
- Cause - Events fire before listeners attached or before element stable
- Solution - Use
untilEvent()helper and ensure stability
Visual Regression Failures
Theme Attribute Mismatch
- Symptom - Visual test fails with theme-related differences
- Cause - Theme attribute not set correctly in template
- Solution - Ensure
nve-themeattribute matches test name
Viewport Size Issues
- Symptom - Screenshots show different dimensions than expected
- Cause - Content overflows or viewport not consistent
- Solution - Use explicit containers or adjust viewport in test config
Acceptable Diff Threshold
Default: maxDiffPercentage < 1
Visual differences under 1% are acceptable due to:
- Sub-pixel rendering variations
- Font rendering differences across OS
- Anti-aliasing variations
If diff exceeds 1%, investigate actual visual change or update baseline.
Lighthouse Failures
Performance Score Below 100
-
Causes:
- Bundle size too large
- Unoptimized images
- Blocking resources
- Excessive JavaScript execution
-
Solutions:
- Bundle Size Guidelines:
- Simple components: < 12 KB
- Interactive components: < 18 KB
- Complex components: < 25 KB
- Rich editors/specialized - Document in test
Accessibility Score Below 100
-
Common Issues:
- Missing ARIA labels
- Insufficient color contrast
- Missing focus indicators
- Invalid ARIA attributes
-
Solution - Run accessibility tests and fix violations
See accessibility testing guide for details.
Best Practices Score Below 100
-
Common Issues:
- Console errors in production
- Deprecated APIs usage
- Missing error handling
- Inefficient patterns
-
Solution - Review Lighthouse report details and fix issues
Build Failures
Wireit Cache Issues
- Symptom - Build fails with outdated errors or missing dependencies
- Cause - Stale Wireit cache
- Solution - Reset CI environment
This clears all caches and reinstalls dependencies.
TypeScript Compilation Errors
- Symptom - Type errors in CI but not locally
- Cause - Different TypeScript version or stale build cache
- Solutions:
Git LFS Issues
Missing Visual Test Baselines
- Symptom - Visual tests fail with "baseline not found"
- Cause - Git LFS files not pulled
- Solution - Pull LFS files
Development Environment
Node Version Mismatch
- Symptom - Build or tests fail with Node compatibility errors
- Cause - Wrong Node.js version
- Solution - Install the repository toolchain with mise
pnpm Version Issues
- Symptom - Install fails or lockfile changes unexpectedly
- Cause - Wrong pnpm version
- Solution - Install the repository toolchain with mise
Port Conflicts in Dev Mode
- Symptom: Dev server fails to start with "port already in use"
- Cause - Another process using the port
- Solution:
Performance Regressions
Test Suite Running Slowly
- Symptom - Tests take much longer than before
- Causes & Solutions:
- Recreating fixtures in every test
For sequential tests, create a shared fixture in beforeAll and remove it in afterAll. Restore any state that tests change in beforeEach. This example resets the form controls to their defaults. Use a fresh fixture per test when a full reset is impractical.
- Missing test parallelization
- Unnecessary elementIsStable() calls
Build Time Regression
Symptom CI builds take much longer than expected Causes & Solutions:
- Wireit cache not working
- Check
filesandoutputarrays are accurate - Verify no gitignored files in
filesarray
- Missing dependency parallelization
- Review Wireit dependencies in package.json
- Ensure independent tasks don't list each other as dependencies
- Large bundle sizes
- Check for accidental bundling of dev dependencies
- Use bundle analyzer:
ANALYZE=true pnpm run build
CI/CD Issues
Pipeline Timeout
- Symptom - CI job exceeds time limit
- Cause - Hung tests or infinite loops
- Solution - Add timeouts to tests
Getting Help
When troubleshooting:
- Check CI logs - Full error messages often in collapsed sections
- Reproduce locally - Run exact CI command locally
- Compare with working example - Check similar components/projects
- Review recent changes - Use
git diff mainto see what changed - Clear all caches -
pnpm run ci:reseteliminates cache issues
Related Documentation
- Testing Guidelines - Test patterns and best practices
- Unit Testing - Unit test patterns
- Visual Testing - Visual regression details
- Lighthouse Testing - Performance testing
- Build System - Wireit configuration