Bindings are not being autocompleted in React Workers Static Assets example

I have created a new project via https://developers.cloudflare.com/workers/frameworks/framework-guides/react/ Below is my wrangler.jsonc
/**
* For more details on how to configure Wrangler, refer to:
* https://developers.cloudflare.com/workers/wrangler/configuration/
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "generator",
"main": "worker/index.ts",
"compatibility_date": "2025-04-13",
"assets": {
"not_found_handling": "single-page-application"
},
"observability": {
"enabled": true
},
"placement": { "mode": "smart" },
"ai": {
"binding": "AI"
}
}
/**
* For more details on how to configure Wrangler, refer to:
* https://developers.cloudflare.com/workers/wrangler/configuration/
*/
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "generator",
"main": "worker/index.ts",
"compatibility_date": "2025-04-13",
"assets": {
"not_found_handling": "single-page-application"
},
"observability": {
"enabled": true
},
"placement": { "mode": "smart" },
"ai": {
"binding": "AI"
}
}
Below is my worker/index.ts
export default {
fetch(request, env) {
const url = new URL(request.url);

if (url.pathname.startsWith("/api/")) {
return api.fetch(request);
}
return new Response(null, { status: 404 });
},
} satisfies ExportedHandler<Env>;
export default {
fetch(request, env) {
const url = new URL(request.url);

if (url.pathname.startsWith("/api/")) {
return api.fetch(request);
}
return new Response(null, { status: 404 });
},
} satisfies ExportedHandler<Env>;
Now, when I try to do env., it should show me the AI binding which I have configured. However it does not. I have also generated the types by running the cf-typegen command
Cloudflare Docs
React · Cloudflare Workers docs
Create a React application and deploy it to Cloudflare Workers with Workers Assets.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?