Uncaught Error: No such module "__STATIC_CONTENT_MANIFEST".

Getting this error in deployment while the pages site is working fine on local.
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "__STATIC_CONTENT_MANIFEST".
imported from "functionsWorker-0.3197352690414583.js"
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "__STATIC_CONTENT_MANIFEST".
imported from "functionsWorker-0.3197352690414583.js"
No description
14 Replies
Cyb3r-Jak3
Cyb3r-Jak314mo ago
__STATIC_CONTENT_MANIFEST shouldn't be needed with Pages. Are you using workers sites?
Vikash
VikashOP14mo ago
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.
Vikash
VikashOP14mo ago
It says to add bucket in wrangler.toml to serve static files [site] bucket = "./public"
Cyb3r-Jak3
Cyb3r-Jak314mo ago
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/_
Vikash
VikashOP14mo ago
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 …
Vikash
VikashOP14mo ago
Any suggestion, how to return the static assets. Like CSS, JS from /public directory
Cyb3r-Jak3
Cyb3r-Jak314mo ago
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
Vikash
VikashOP14mo ago
Here is my code -
No description
Cyb3r-Jak3
Cyb3r-Jak314mo ago
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 other
Vikash
VikashOP14mo ago
I am bit confused now, it was working perfectly fine until I started using the serveStatic function and Pages CI was deploying the app properly.
Cyb3r-Jak3
Cyb3r-Jak314mo ago
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.
Vikash
VikashOP14mo ago
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 -
app.get("/public/*", async (ctx) => {
return await ctx.env.ASSETS.fetch(ctx.req.raw);
});
app.get("/public/*", async (ctx) => {
return await ctx.env.ASSETS.fetch(ctx.req.raw);
});
But for me, it throwing error - Can
Vikash
VikashOP14mo ago
No description
Vikash
VikashOP14mo ago
GitHub
sonicjs/src/server.ts at c626a284d00f1e9168ef952be8d52eef4cbbfd8f ·...
SonicJs Headless CMS - Blazinflg Fast Headless CMS built on Cloudflare Workers. 100% Javascript Based - lane711/sonicjs
Want results from more Discord servers?
Add your server