Troubleshooting
Here are solutions to some common issues you might encounter during CMS integration.
-
404 Errors on Pages: If you are getting 404 errors for your CMS pages, the most likely cause is in your
CMSProvider. Double-check thegetPageimplementation to ensure it's correctly fetching data from your CMS and transforming it into the required ArchibaldPageformat without errors. -
Preview Mode Not Working: Preview mode often requires special configuration.
- Check that you have correctly configured the
previewOptionson yourCMSClient. - Ensure your
CMSAdapter'sgetPreviewWrapperComponentis working as expected if you use a script-based preview system like Contentful's. - Verify that your
CMSProvidercorrectly handles preview-related parameters (like a preview ticket or token) when fetching data.
- Check that you have correctly configured the
-
Data Mismatches between Server and Client: This can happen during hydration if the data rendered on the server is different from what the client expects. Ensure that the data transformation logic is consistent between your
CMSProvider(server) and any client-side data handling. -
CORS Errors: If you are getting Cross-Origin Resource Sharing (CORS) errors, it means your CMS API is not configured to allow requests from your application's domain, especially when fetching from the browser. Ensure your CMS's CORS policy whitelists your development and production domains.