export interface Env at the top, and the other doesn't.export interface Env {
STATIC_PAGE_HANDLER_AUTH_KEY_SECRET: string;
}// Access the STATIC_PAGE_HANDLER_AUTH_KEY_SECRET from the environment
const authKeySecret = env.STATIC_PAGE_HANDLER_AUTH_KEY_SECRET;// Check requests for a pre-shared secret
const hasValidHeader = (request) => {
return request.headers.get("X-Custom-Auth-Key") === authKeySecret;
};✘ [ERROR] service core:user:static-page-handler: Uncaught ReferenceError: env is not defined
at null.<anonymous> (index.js:1013:21)
✘ [ERROR] The Workers runtime failed to start. There is likely additional logging output above.export interface Env {
STATIC_PAGE_HANDLER_AUTH_KEY_SECRET: string;
}// Check requests for a pre-shared secret
const hasValidHeader = (request) => {
// Access the STATIC_PAGE_HANDLER_AUTH_KEY_SECRET from the environment
const authKeySecret = env.STATIC_PAGE_HANDLER_AUTH_KEY_SECRET;
return request.headers.get("X-Custom-Auth-Key") === authKeySecret;
};
