Troubleshooting
Common issues and solutions when working with this template.
Installation Issues
pnpm Not Found
Symptom:
pnpm: command not foundSolution:
Enable Corepack (included with Node.js 16.13+):
corepack enableOr install pnpm globally:
npm install -g pnpmWrong pnpm Version
Symptom:
ERR_PNPM_UNSUPPORTED_ENGINE Unsupported pnpm versionSolution:
The template uses a specific pnpm version defined in package.json:
{
"packageManager": "pnpm@9.0.0"
}Enable Corepack to use the correct version automatically:
corepack enable
corepack prepareNode Version Error
Symptom:
error your-package@1.0.0: The engine "node" is incompatibleSolution:
This template requires Node.js 20+. Check your version:
node --versionUse nvm or fnm to install Node.js 20:
# With nvm
nvm install 20
nvm use 20
# With fnm
fnm install 20
fnm use 20Lockfile Out of Sync
Symptom:
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile"Solution:
Update the lockfile:
pnpm installThen commit the updated pnpm-lock.yaml.
Build Issues
TypeScript Errors in Build
Symptom:
✘ [ERROR] Could not resolve "..."Possible causes:
- Missing dependency — Install the package
- Wrong import path — Check relative paths
- tsconfig issue — Verify paths configuration
Debug:
# Check types first
pnpm run typecheck
# Then build
pnpm run buildtsup Build Fails
Symptom:
Build failed with X error(s)Common fixes:
- Check
tsup.config.tsentry points exist - Ensure source files have no syntax errors
- Verify all imports resolve
Verbose output:
pnpm tsup --debugNo Output in dist/
Symptom: Build succeeds but dist/ is empty or missing files
Check:
Verify entry points in
tsup.config.ts:typescriptentry: ["src/index.ts"]; // Must match your sourceEnsure source files exist at those paths
Check for
clean: truerunning at unexpected times
Lint Issues
ESLint Flat Config Error
Symptom:
ESLint couldn't find a configuration fileSolution:
This template uses ESLint 9 flat config. Ensure you're using ESLint 9+:
pnpm eslint --versionThe config file is eslint.config.mjs (not .eslintrc).
Prettier Conflicts
Symptom: ESLint and Prettier disagree on formatting
Solution:
This template uses eslint-config-prettier to disable conflicting rules. If you still see conflicts:
Run Prettier first, then ESLint:
bashpnpm format pnpm lint --fixOr use the combined command:
bashpnpm lint:staged
knip False Positives
Symptom: knip reports used code as unused
Common cases:
- Dynamic imports — knip can't analyze them
- Config files — Some patterns aren't detected
- Scripts — Files only used in npm scripts
Solution:
Add to knip.json:
{
"ignore": ["scripts/**", "docs/.vitepress/**"],
"ignoreDependencies": ["some-dev-dependency"]
}publint Errors
Symptom:
npm WARN publintCommon issues:
| Error | Fix |
|---|---|
Missing exports | Add exports field to package.json |
Wrong types path | Point to correct .d.ts file |
Missing files entry | Add built files to files array |
Debug:
pnpm publintThis shows detailed explanations for each issue.
Test Issues
Tests Not Found
Symptom:
No test files foundCheck:
Test files match the pattern in
vitest.config.ts:typescriptinclude: ["**/*.{test,spec}.{js,ts}"];Test files are not excluded:
typescriptexclude: ["node_modules", "dist"];
Import Errors in Tests
Symptom:
Cannot find module '../src/...'Solution:
Use the configured path aliases or relative imports:
// If using aliases
import { hello } from "@/index";
// Or relative paths
import { hello } from "../src/index";Coverage Not Generating
Symptom: Tests pass but no coverage report
Solution:
Run tests with coverage flag:
pnpm test --coverageOr use the coverage script:
pnpm run test:coverageGit Hooks Issues
Hooks Not Running
Symptom: Commit succeeds without running lint-staged
Possible causes:
Husky not installed — Run:
bashpnpm exec husky installGit version too old — Husky requires Git 2.9+
bashgit --versionHooks bypassed — Someone used
--no-verify
lint-staged Failing
Symptom:
✖ lint-staged failedDebug:
# Run lint-staged manually with verbose output
pnpm lint-staged --verboseCommon fixes:
- Fix the linting errors shown
- Stage the fixes:
git add . - Try the commit again
Permission Denied on Hook
Symptom:
.husky/pre-commit: Permission deniedSolution (Unix/Mac):
chmod +x .husky/pre-commit
chmod +x .husky/pre-pushSolution (Windows):
This usually happens in WSL. Try:
git config core.filemode falseDocumentation Issues
VitePress Build Fails
Symptom:
[vitepress] Error when buildingCommon causes:
- Broken links — Check for dead internal links
- Invalid frontmatter — YAML syntax errors
- Missing files — Referenced images/files don't exist
Debug:
pnpm docs:devDevelopment mode shows more detailed errors.
API Docs Not Updating
Symptom: Changed source code but API docs are outdated
Solution:
Regenerate API documentation:
pnpm run docs:apiTypeDoc needs to run again after source changes.
404 on GitHub Pages
Symptom: Docs deploy succeeds but pages show 404
Causes:
Wrong base path — Check
docs/.vitepress/config.mts:typescriptbase: "/your-repo-name/";Pages not enabled — Go to Settings → Pages → set Source to "GitHub Actions"
First deploy — Wait a few minutes, then hard refresh
See GitHub Pages for detailed setup.
Release Issues
Changeset Not Found
Symptom:
No changesets foundSolution:
Create a changeset before committing:
pnpm changesetVersion PR Not Created
Symptom: Pushed changesets but no Version PR appears
Check:
- Release workflow ran (Actions tab)
- Workflow has
pull-requests: writepermission GITHUB_TOKENhas correct scope
npm Publish Fails
Symptom:
npm ERR! 403 ForbiddenCauses:
- No NPM_TOKEN — Add it to repository secrets
- Token expired — Generate a new one
- Name taken — Package name already exists on npm
- No publish access — Token needs write permission
Check npm token:
npm whoami --registry https://registry.npmjs.org/Wrong Version Published
Symptom: Published version doesn't match expected
Check:
- Changeset specified correct bump (patch/minor/major)
- No manual
package.jsonversion edits - Version PR was reviewed before merge
IDE Issues
TypeScript Errors Not Matching
Symptom: VS Code shows different errors than pnpm typecheck
Solution:
Restart TypeScript server:
Cmd+Shift+P→ "TypeScript: Restart TS Server"
Check VS Code uses workspace TypeScript:
Cmd+Shift+P→ "TypeScript: Select TypeScript Version"- Choose "Use Workspace Version"
ESLint Not Working in VS Code
Symptom: No ESLint errors shown in editor
Solution:
Install ESLint extension
Enable flat config support (VS Code settings):
json{ "eslint.experimental.useFlatConfig": true }Reload VS Code window
Getting More Help
If your issue isn't covered here:
- Search existing issues — GitHub Issues
- Check tool documentation — Each tool has its own docs
- Create a minimal reproduction — Helps identify the problem
- Open an issue — Include error messages and steps to reproduce
Useful Debug Commands
# Check all versions
node --version
pnpm --version
pnpm eslint --version
pnpm tsc --version
# Verbose output
pnpm install --reporter=ndjson
pnpm tsup --debug
pnpm lint-staged --verbose
pnpm vitest --reporter=verbose
# Check package.json validity
pnpm pack --dry-run
pnpm publint
# Clear caches
rm -rf node_modules
rm -rf dist
pnpm store prune
pnpm install