Persistent Incomplete Static JSON File Deployment Issue

Hey Team,

I am experiencing a critical and persistent issue with my project’s static file deployment, specifically with JSON product definition files, and I’m hoping you can assist. Despite extensive troubleshooting on my end, the issue persists, indicating a problem on the Vercel platform’s serving or build process for these specific assets.

Project Details:

  • Vercel Project Name: tom-roxboroughs-projects / thornevald
  • Domain: www.thornevald.com

Problem Description: When deploying my Vite/React application, specifically the public/products/*.json static files, they are consistently being served in an incomplete format, leading to critical errors with a third-party e-commerce integration (Snipcart).

Details of the Issue: My e-commerce integration relies on Snipcart crawling a specific JSON file for each product (e.g., https://www.thornevald.com/products/grimwood-ghost.json) to validate item data. However, the JSON files being served from Vercel are incomplete.

  • **Expected Content (Local public/products/grimwood-ghost.json and dist/products/grimwood-ghost.json after npm run build):

  • **JSON{ "id": "grimwood-ghost", "name": "THE LITTLE GHOST OF GRIMWOOD", "price": 10.00, "url": "/products/grimwood-ghost.json", "image": "/images/grimwood-ghost.jpg" }

(Note: This structure is consistent across all product JSON files.)

  • **Actual Content Served from Vercel’s CDN (verified via Incognito browser access to https://www.thornevald.com/products/grimwood-ghost.json and DevTools, even minutes after a fresh deploy):

****JSON { "id": "grimwood-ghost", "url": "/products/grimwood-ghost.json", }

As you can see, the name, price, description, and image fields are missing from the served file.

Impact: Snipcart’s crawler is reporting errors like Reason: 'product-crawling-failed' and [Status] PriceNotFound because it cannot find the expected product data (specifically the price) in the incomplete JSON it retrieves.

Troubleshooting Steps Already Performed (Extensive):

  1. Local File Verification: Confirmed that all public/products/*.json files on my local machine contain the complete and correct product data (including name, price, description, image, and no comments).

  2. Local Build Verification: Confirmed that after running npm run build, the dist/products/*.json files locally contain the complete and correct product data.

  3. GitHub Push: Ensured all local changes, including the updated JSON files, have been successfully git add, git commit, and git pushed to the main branch of my GitHub repository (github.com/tom-roxborough/book-app).

  4. Vercel Deployment Trigger: Confirmed Vercel is set to auto-deploy from main branch.

  5. Vercel Build Logs Review: Reviewed the build logs for the latest deployments on Vercel. They show no errors or warnings related to the public directory, static asset copying, or the build process itself (Vite reports a successful build).

  6. Vercel Cache Purging: Performed multiple redeploys, explicitly selecting “Redeploy without Build Cache.” I also manually purged both “CDN Cache” and “Data Cache” from the “Caches” section in Vercel project settings.

  7. Live URL Direct Access: Verified directly in multiple Incognito browser windows, immediately after a fresh Vercel deploy and cache purge, that https://www.thornevald.com/products/grimwood-ghost.json (and other similar product JSONs) still serves the incomplete JSON content, despite the file being updated locally. The Date and Last-Modified headers on the served incomplete file indicate it’s very recent, confirming it’s not simply an old CDN cache.

  8. Snipcart Button Configuration: Confirmed the snipcart-add-item button in BookDetail.tsx is correctly configured (data-item-url points to the JSON, data-item-json-url is removed).

Request:

Given that my local files and build output are correct, and Vercel’s logs show a successful build, but the served static files are incomplete, I believe this points to an issue within Vercel’s platform. Could you please investigate why the complete contents of my public/products/*.json files are not being deployed or served correctly from the Vercel CDN?

Thank you for your time and assistance in resolving this critical issue.

Hi everyone,

Following up on my issue regarding the grimwood-ghost.json file being incomplete on Vercel despite appearing correct locally and on GitHub. After extensive troubleshooting, I’m happy to report this has been resolved, and the root cause appears to have been an unusual state within the Vercel project itself rather than my code or Git setup.

The Problem:

  • My local project’s public/products/grimwood-ghost.json file was complete.
  • After running npm run build locally, the dist/products/grimwood-ghost.json file was also complete.
  • My GitHub repository’s main branch clearly showed the complete JSON content in its history, and the latest commit included these updates.
  • However, Vercel deployments (specifically the “Source” tab for them) consistently showed an incomplete version of the JSON file.
  • The publicly served file on thornevald.com was also incomplete.
  • Attempts to clear CDN cache did not resolve the issue.
  • Crucially, even after pushing new commits to GitHub, Vercel was not triggering new builds from the head of my main branch. Instead, it was only performing “Redeploy of…” older deployment IDs, which meant it kept rebuilding from an outdated source.
  • Manual attempts to “Create Deployment” by specifying the correct, latest commit hash also failed with a strange “A commit author is required” error.

The Solution:

After exhausting all other troubleshooting steps, the resolution was to delete the existing Vercel project (thornevald) and create a brand new one from scratch, re-importing the GitHub repository.

  1. I noted down all environment variables and custom domain settings from the old project.
  2. I deleted the old Vercel project.
  3. I created a new project in Vercel, importing the same tom-roxborough/book-app GitHub repository.
  4. For the build settings, I confirmed: Build Command: npm run build, Output Directory: dist, Install Command: npm install.
  5. Upon the first deployment of the new project, the grimwood-ghost.json file correctly appeared complete in the Vercel “Source” tab for the new deployment and was served correctly on the new Vercel domain.

Conclusion:

It appears my old Vercel project entered into a corrupted state where it was no longer syncing correctly with the latest changes on my GitHub main branch and was unable to be forced to do so. A fresh project creation resolved this.

Hopefully, this detailed breakdown helps anyone else encountering similar highly persistent and unusual static file serving issues on Vercel!

God bless you

1 Like

Thank you for coming back with a solution! :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.