Cannot find module '__STATIC_CONTENT_MANIFEST' or its corresponding type declarations

I'm using Hono and I want to serve some static files with my Cloudflare worker. I followed the docs and added a worker-site bucket which is the place where my static files are stored, and my index.ts now looks like this:
import { Hono } from 'hono'
import { serveStatic } from 'hono/cloudflare-workers'
import manifest from '__STATIC_CONTENT_MANIFEST'

const app = new Hono()

app.get('/favicon.ico', serveStatic({ path: './static/favicon.ico', manifest }));

export default app;
import { Hono } from 'hono'
import { serveStatic } from 'hono/cloudflare-workers'
import manifest from '__STATIC_CONTENT_MANIFEST'

const app = new Hono()

app.get('/favicon.ico', serveStatic({ path: './static/favicon.ico', manifest }));

export default app;
However TypeScript says: Cannot find module '__STATIC_CONTENT_MANIFEST' or its corresponding type declarations. How to solve this issue?
2 Replies
Jürgen Leschner
Hi @PneuTueur I had the same issue, and got around it by ignoring the TypeScript error with a comment // @ts-expect-error.
https://github.com/jldec/presskit/blob/main/packages/worker/src/index.tsx#L21-L25 (It's not the most satisfying - please post back here if you find a better solution - e.g. in https://github.com/honojs/hono/issues/1127)
GitHub
Issues · honojs/hono
Web framework built on Web Standards. Contribute to honojs/hono development by creating an account on GitHub.
GitHub
presskit/packages/worker/src/index.tsx at main · jldec/presskit
https://presskit.jldec.me. Contribute to jldec/presskit development by creating an account on GitHub.
PneuTueur
PneuTueur4w ago
Thank you! it seems to be a bug from TS
Want results from more Discord servers?
Add your server