i tried to placing the scheduled function in separate file but bot working as expected
i tried to placing the scheduled function in separate file but bot working as expected
main file. For example: @types/node installed per chance? Or is something loading webworker or other similar types? What file openes if you browse to that erroring type?res is assigned?AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: from the client - doesn't even hit the RPC endpoint)Uncaught (in promise) TypeError: Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)The uploaded script has no registered event handlers. [code: 10068], I don't think I've changed anything that would cause this.. any ideas how I could figure out what's going on?export defaults an object with a fetch handler, I don't see why this error would start appearingA request to the Cloudflare API (/accounts/.../workers/scripts/email-sender-prod/versions) failedworkers dev
@types/nodewrangler deploy --dry-run --outdir ./dist --minify
sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist
wrangler deploy --outdir ./dist --no-bundle ./dist/index.jsAssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:Uncaught (in promise) TypeError: Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)The uploaded script has no registered event handlers. [code: 10068]A request to the Cloudflare API (/accounts/.../workers/scripts/email-sender-prod/versions) failed⎔ Starting local server...
✘ [ERROR] service core:user:email-sender: Uncaught Error: Top-level await in module is unsettled.workers dev✘ [ERROR] A request to the Cloudflare API (/accounts/.../workers/scripts/email-sender-prod/versions) failed.
The uploaded script has no registered event handlers. [code: 10068]// scheduled.ts
async function scheduled(evt, env, ctx) {
// Do some work
}
// index.ts
import { scheduled } from "./scheduled";
export default { scheduled };import { queries } from 'database'
import { handleWebhookRequest } from './postmark-webhook.js';
import { ConfigProvider, Effect, Either, Layer, pipe } from 'effect';
import { AppConfig, AppConfigSchema, MainDatabase, MembershipsDatabase, Lock, TracingAll, tryQuery } from './services.js';
import { handleEmailJobs } from './email-sending.js';
import * as Postmark from './postmark/postmark';
import { FetchHttpClient } from '@effect/platform';
import { Schema as S } from 'effect';
import * as Tracer from "@effect/opentelemetry/Tracer"
import { trace } from "@opentelemetry/api";
import { EmailJobBodySchema, MembershipRenewalEmailJobBodySchema } from './schemas.js';
import { honkAll } from './slack-honks.js';export default class Entrypoint extends WorkerEntrypoint {
async fetch(req: Request) {
console.log('fetch'); // this is not logged
return new Response('ok');
}
async queue(batch: MessageBatch<Message>) {
// this runs on deployed workers fine
}
}curl -X POST http://localhost:8787[wrangler:inf] POST / 500 Internal Server Error