Worker to D1 Binding

For Workers & Pages, what is the name of the domain?

u-pac.org

What is the error number?

1101

What is the error message?

Worker threw exception What happened? You’ve requested a page on a website (sibi-d1-worker.anchorskov.workers.dev) that is on the Cloudflare network. An unknown error occurred while rendering the page. What can I do? If you are the owner of this website: you should login to Cloudflare and check the error logs for sibi-d1-worker.anchorskov.workers.dev.

What is the issue or error you’re encountering

I’m experiencing an issue with my Cloudflare Worker where the D1 binding I configured in my wrangler.toml is not being injected into the Worker’s environment. My Worker is supposed to have access to my D1 database via the binding env.SIBIDRIFT_DB, but when I check the logs, the environment object does not include this variable (it logs as “Default Message”).

What steps have you taken to resolve the issue?

I have checked the location of wrangler.toml checked the d1 information written the index.js

What are the steps to reproduce the issue?

this is the index.js i am trying to connect withexport default {
async fetch(request, env, ctx) {
// Read the environment variable from wrangler.toml
const envMessage = env.ENV_MESSAGE || “Default Message”;
console.log(“Environment message:”, envMessage);
return new Response(Worker says: ${envMessage}, {
headers: { “Content-Type”: “text/plain” }
});
}
};