Skip to main content

Installation Issues

Problem: CLI command is not recognized.Solution: Use bunx or npx to run the CLI:
The package is installed locally, not globally.
Problem: Cannot import from @readonlystore/client.Solutions:
  1. Make sure the package is installed:
  2. Run sync at least once to generate files:
  3. Check that node_modules/_generated/readonly/ exists
Problem: TypeScript doesn’t recognize types from ReadOnly.Solutions:
  1. Run sync to generate types:
  2. Restart your TypeScript server:
    • VS Code: Press Cmd+Shift+P → “TypeScript: Restart TS Server”
  3. Check tsconfig.json includes node_modules:

Authentication Issues

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)
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
  1. Regenerate types:
  2. Restart your TypeScript server
  3. If types are still wrong, file a bug report with your JSON structure
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.
Problem: node_modules/_generated/readonly/ doesn’t exist.Solutions:
  1. Run sync at least once:
  2. Check that sync completed successfully
  3. Verify READONLY_OUTPUT_DIR environment variable (if set)
  4. Check file permissions on node_modules/

Build & Production Issues

Problem: Application can’t find readonly files in production.Solutions:
  1. Run sync before building:
    package.json
  2. Make sure READONLY_API_KEY is set in production environment
  3. Check that cache directory is included in your build
  4. For Docker, add sync to Dockerfile:
Problem: Files missing after deployment.Solutions:
  1. Include sync in your build process (see above)
  2. For serverless, run sync in postinstall:
    package.json
  3. For Docker, sync during image build, not runtime
Problem: Sync fails in CI/CD pipeline.Solutions:
  1. Add READONLY_API_KEY to CI secrets:
    • GitHub: Repository Secrets
    • GitLab: CI/CD Variables
    • CircleCI: Environment Variables
  2. Make sure @readonlystore/client is in dependencies, not devDependencies
  3. Check CI logs for specific error messages

File Content Issues

Problem: Dashboard rejects your JSON file.Solutions:
  1. Validate JSON syntax:
  2. Root must be an object:
  3. Remove trailing commas:
Problem: File size exceeds the maximum limit of 10MBSolutions:
  1. Split large files into smaller ones
  2. Remove unnecessary data
  3. Minify JSON (remove whitespace):
  4. Consider storing large data elsewhere (S3, database, etc.)
Problem: Dashboard rejects file name.Solutions: File names must match: ^[a-zA-Z0-9_-]+$

Development Issues

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
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 imports

Getting 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.

Diagnostic Commands

Run these commands to help diagnose issues:
Include output from these commands when reporting issues.