Troubleshooting

Troubleshooting

This guide addresses common issues you might encounter while using ShipReady. If you don't find a solution to your problem here, please contact our support team.

Table of Contents

  1. Installation Issues
  2. Authentication Problems
  3. API and Data Fetching Errors
  4. Webhook Issues
  5. Billing Integration Problems
  6. App Extensions Troubles
  7. Database Troubles
  8. Deployment Challenges

Installation Issues

Error: Cannot find module

Problem: When running the app, you see an error like "Cannot find module 'some-package'".

Solution:

  1. Ensure all dependencies are installed:
    npm install
  2. If the issue persists, try deleting node_modules and package-lock.json, then run npm install again.

TypeScript Compilation Errors

Problem: You encounter TypeScript errors during build or start.

Solution:

  1. Make sure you're using a compatible TypeScript version (check package.json).
  2. Run npx tsc --noEmit to see detailed type errors.
  3. Address each error, updating types as necessary.

Authentication Problems

OAuth Error: Invalid Request

Problem: During app installation, you receive an "Invalid Request" error.

Solution:

  1. Verify your SHOPIFY_API_KEY and SHOPIFY_API_SECRET in .env.
  2. Ensure your app's Allowed Redirection URL(s) in the Shopify Partner dashboard includes https://your-app-url.com/auth/callback.

Session Token Invalid

Problem: Users are unexpectedly logged out or receive session invalid errors.

Solution:

  1. Check that your app's session storage is configured correctly.
  2. Verify that your server's time is synchronized (NTP issues can cause this).

API and Data Fetching Errors

GraphQL Errors

Problem: Your GraphQL queries are failing or returning unexpected results.

Solution:

  1. Double-check your query syntax.
  2. Ensure you have the necessary scopes for the data you're requesting.
  3. Use the GraphiQL app in your Shopify Partner dashboard to test queries.

Rate Limiting Issues

Problem: You're hitting Shopify's API rate limits.

Solution:

  1. Implement request batching for bulk operations.
  2. Use the graphql-query-complexity package to optimize your queries.
  3. Implement caching for frequently accessed, rarely changing data.

Webhook Issues

Webhooks Not Receiving Data

Problem: Your app is not receiving webhook events from Shopify.

Solution:

  1. Verify your webhook URLs in the Shopify Partner dashboard.
  2. Ensure your server is accessible from the internet (not localhost).
  3. Check your webhook endpoint is correctly handling Shopify's HMAC validation.

Billing Integration Problems

Charges Not Being Applied

Problem: Users aren't being charged, or charges are failing.

Solution:

  1. Verify your billing settings in the Shopify Partner dashboard.
  2. Ensure you're using the correct API calls for creating and activating charges.
  3. Check that your app is correctly handling the charge activation callback.

App Extensions Troubles

App Blocks Not Appearing in Theme Editor

Problem: Your app blocks are not showing up in the Shopify theme editor.

Solution:

  1. Verify your blocks folder structure matches Shopify's requirements.
  2. Ensure your schema tags are correctly formatted in your liquid files.
  3. Check that your app is installed on the store where you're testing.

Database Troubles

If you're using SQLite instead of postgres, you may encounter issues with database migrations and data integrity.

Solution:

  1. Delete migrations folder from prisma/ directory.
  2. Delete the prisma/dev.sqlite file.
  3. Run npx prisma migrate dev --name init to recreate the migrations.
  4. Run npx prisma generate to regenerate the Prisma client.

Now run npm run dev again and it should work as expected. Please note, SQLite is not recommended for production use and you should consider migrating to a more robust database like PostgreSQL.

Deployment Challenges

App Crashing on Deployment

Problem: Your app works locally but crashes when deployed.

Solution:

  1. Check your deployment logs for specific error messages.
  2. Ensure all environment variables are correctly set in your deployment platform.
  3. Verify that your build and start scripts in package.json are correct.

CORS Issues After Deployment

Problem: You're seeing CORS errors in the browser console after deployment.

Solution:

  1. Ensure your app's URL is correctly set in the Shopify Partner dashboard.
  2. Check that your server is properly handling CORS headers.
  3. Verify that all your API requests are going to the correct deployed URL, not localhost.

If you're still experiencing issues after trying these solutions, please review our documentation, or contact our support team for further assistance.