Installation Issues
Command not found: readonly
Command not found: readonly
Problem: CLI command is not recognized.Solution: Use The package is installed locally, not globally.
bunx or npx to run the CLI:Module not found: @readonly/client
Module not found: @readonly/client
Problem: Cannot import from
@readonly/client.Solutions:-
Make sure the package is installed:
-
Run sync at least once to generate files:
-
Check that
node_modules/_generated/readonly/exists
TypeScript cannot find types
TypeScript cannot find types
Problem: TypeScript doesn’t recognize types from ReadOnly.Solutions:
-
Run sync to generate types:
-
Restart your TypeScript server:
- VS Code: Press
Cmd+Shift+P→ “TypeScript: Restart TS Server”
- VS Code: Press
-
Check
tsconfig.jsonincludesnode_modules:
Authentication Issues
Missing READONLY_API_KEY
Missing READONLY_API_KEY
Problem:
Missing READONLY_API_KEY environment variable Solutions: 1. Set the environment variable:
bash export READONLY_API_KEY=ro_your_key_here 2. Or create a .env file: bash READONLY_API_KEY=ro_your_key_here 3. Make sure your .env loader is configured (if using one)Invalid API key
Invalid API key
Problem:
Invalid API key error when syncing. Solutions: 1. Verify your API key is correct (copy from
dashboard) 2. Check for whitespace or special characters: ```bash echo $READONLY_API_KEY # Should start with ro_Make sure you're using the right project's API key 4. Try regenerating the API key from the dashboard
-
Regenerate types:
- Restart your TypeScript server
- If types are still wrong, file a bug report with your JSON structure
Type inference for arrays
Type inference for arrays
Problem: Array types are too broad or inaccurate.Explanation: ReadOnly infers types from the actual values in your JSON. Mixed arrays will have union types.Example:Generates:Solution: Keep arrays homogeneous for better type inference.
Cannot find generated files
Cannot find generated files
Problem:
node_modules/_generated/readonly/ doesn’t exist.Solutions:-
Run sync at least once:
- Check that sync completed successfully
-
Verify
READONLY_OUTPUT_DIRenvironment variable (if set) -
Check file permissions on
node_modules/
Build & Production Issues
Files not found in production
Files not found in production
Problem: Application can’t find readonly files in production.Solutions:
-
Run sync before building:
package.json
-
Make sure
READONLY_API_KEYis set in production environment - Check that cache directory is included in your build
-
For Docker, add sync to Dockerfile:
Cache cleared after deploy
Cache cleared after deploy
Problem: Files missing after deployment.Solutions:
- Include sync in your build process (see above)
-
For serverless, run sync in postinstall:
package.json
- For Docker, sync during image build, not runtime
CI/CD sync failing
CI/CD sync failing
Problem: Sync fails in CI/CD pipeline.Solutions:
-
Add
READONLY_API_KEYto CI secrets:- GitHub: Repository Secrets
- GitLab: CI/CD Variables
- CircleCI: Environment Variables
-
Make sure
@readonly/clientis independencies, notdevDependencies - Check CI logs for specific error messages
File Content Issues
JSON validation failed
JSON validation failed
Problem: Dashboard rejects your JSON file.Solutions:
-
Validate JSON syntax:
-
Root must be an object:
-
Remove trailing commas:
File size exceeded
File size exceeded
Problem:
File size exceeds the maximum limit of 10MBSolutions:- Split large files into smaller ones
- Remove unnecessary data
-
Minify JSON (remove whitespace):
- Consider storing large data elsewhere (S3, database, etc.)
Invalid file name
Invalid file name
Problem: Dashboard rejects file name.Solutions:
File names must match:
^[a-zA-Z0-9_-]+$Development Issues
Hot reload not working
Hot reload not working
Problem: Changes don’t reflect in development. Solutions: 1. Use watch mode:
bash bunx readonly dev 2. Restart your dev server after syncing 3. Clear build cache and restart: bash rm -rf .next # for Next.js rm -rf dist # for Vite Import errors after updating files
Import errors after updating files
Problem: TypeScript errors after updating file structure. Solutions: 1. Restart TypeScript server 2.
Regenerate types:
bash bunx readonly codegen 3. If structure changed significantly, update your importsGetting Help
If you’re still experiencing issues:Email Support
Send us an email with details about your issue.
GitHub Issues
Report bugs or request features on GitHub.
Documentation
Review the documentation for more details.
Dashboard
Check your project settings in the dashboard.