Uncaught Error: No such module "__STATIC_CONTENT_MANIFEST".
Getting this error in deployment while the pages site is working fine on local.
14 Replies
__STATIC_CONTENT_MANIFEST
shouldn't be needed with Pages. Are you using workers sites?I was following this to server static CSS, JS etc.
https://hono.dev/getting-started/cloudflare-workers#serve-static-files
Cloudflare Workers - Hono
Ultrafast web framework for Cloudflare Workers, Fastly Compute@Edge, Deno, Bun, Vercel, Lagon, Node.js, and others. Fast, but not only fast.
It says to add bucket in wrangler.toml to serve static files
[site]
bucket = "./public"
Yeah that's not Pages, that's workers sites which is a different way of severing static assets and can't use Pages CI
Don't know what your project looks like but I would recommend looking at the getting started guide of Pages (https://developers.cloudflare.com/pages/get-started/guide/_
The project is exact this form your examples https://developers.cloudflare.com/pages/framework-guides/deploy-a-hono-site/
Deploy a Hono site · Cloudflare Pages docs
Hono is a small, simple, and ultrafast web framework for Cloudflare Pages and Workers, Deno, and Bun. In this guide, you will create a new Hono …
Any suggestion, how to return the static assets. Like CSS, JS from /public directory
I don't work for Cloudflare, I am a volunteer. You linked hono for workers and you are using pages so the link should be https://hono.dev/getting-started/cloudflare-pages. Again, depending on your code, using workers sites can work but if your site has simple function logic then Pages is better and cheaper
Here is my code -
I mean that looks like it is better for worker's sites in which case you need to do
wrangler deploy
from your project directory and can't use Pages CI to deploy it.
As well as remove the import { handle } from hono/cloudflare-pages
. You are using two different projects that conflict with each otherI am bit confused now, it was working perfectly fine until I started using the
serveStatic
function and Pages CI was deploying the app properly.Because
serveStatic
is related to Cloudflare workers with workers sites, which can’t use Pages CI. Your code before that would have been all Cloudflare pages.Ok, noted the limit and moved my static assets to S3 removing
serveStatic
By the way, it must be super easier for your dev team to add this functionality in pages 🙂
I found another way used by some developers -
But for me, it throwing error - CanIt's used in this pages project, https://github.com/lane711/sonicjs/blob/c626a284d00f1e9168ef952be8d52eef4cbbfd8f/src/server.ts#L44
GitHub
sonicjs/src/server.ts at c626a284d00f1e9168ef952be8d52eef4cbbfd8f ·...
SonicJs Headless CMS - Blazinflg Fast Headless CMS built on Cloudflare Workers. 100% Javascript Based - lane711/sonicjs