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
- Installation Issues
- Authentication Problems
- API and Data Fetching Errors
- Webhook Issues
- Billing Integration Problems
- App Extensions Troubles
- Database Troubles
- Deployment Challenges
Installation Issues
Error: Cannot find module
Problem: When running the app, you see an error like "Cannot find module 'some-package'".
Solution:
- Ensure all dependencies are installed:
npm install
- If the issue persists, try deleting
node_modules
andpackage-lock.json
, then runnpm install
again.
TypeScript Compilation Errors
Problem: You encounter TypeScript errors during build or start.
Solution:
- Make sure you're using a compatible TypeScript version (check
package.json
). - Run
npx tsc --noEmit
to see detailed type errors. - Address each error, updating types as necessary.
Authentication Problems
OAuth Error: Invalid Request
Problem: During app installation, you receive an "Invalid Request" error.
Solution:
- Verify your
SHOPIFY_API_KEY
andSHOPIFY_API_SECRET
in.env
. - 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:
- Check that your app's session storage is configured correctly.
- 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:
- Double-check your query syntax.
- Ensure you have the necessary scopes for the data you're requesting.
- 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:
- Implement request batching for bulk operations.
- Use the
graphql-query-complexity
package to optimize your queries. - 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:
- Verify your webhook URLs in the Shopify Partner dashboard.
- Ensure your server is accessible from the internet (not localhost).
- 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:
- Verify your billing settings in the Shopify Partner dashboard.
- Ensure you're using the correct API calls for creating and activating charges.
- 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:
- Verify your
blocks
folder structure matches Shopify's requirements. - Ensure your
schema
tags are correctly formatted in your liquid files. - 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:
- Delete migrations folder from prisma/ directory.
- Delete the
prisma/dev.sqlite
file. - Run
npx prisma migrate dev --name init
to recreate the migrations. - 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:
- Check your deployment logs for specific error messages.
- Ensure all environment variables are correctly set in your deployment platform.
- Verify that your
build
andstart
scripts inpackage.json
are correct.
CORS Issues After Deployment
Problem: You're seeing CORS errors in the browser console after deployment.
Solution:
- Ensure your app's URL is correctly set in the Shopify Partner dashboard.
- Check that your server is properly handling CORS headers.
- 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.