windymelt
windymelt
CDCloudflare Developers
Created by windymelt on 5/30/2024 in #workers-help
Worker is rejecting machine-generated ESModule
I'm using Scala.js, Scala compiler for ECMAScript (like TypeScript). When I upload worker with scheduled handler, Cloudflare rejects content: The uploaded script has no registered event handlers. (10068). What kind of handler does Cloudflare accept? Only plain ESModule? Should I use old script style instead of ESModule? My module that finally exports default and scheduled:
// ...
$c_LDefault$.prototype.scheduled = (function(arg, arg$2, arg$3) {
return this.scheduled__sjs_js_Object__sjs_js_Object__LCtx__sjs_js_Promise(arg, arg$2, arg$3);
});
var $d_LDefault$ = new $TypeData().initClass($c_LDefault$, "Default$", ({
LDefault$: 1
}));
var $n_LDefault$;
function $m_LDefault$() {
if ((!$n_LDefault$)) {
$n_LDefault$ = new $c_LDefault$();
}
return $n_LDefault$;
}
// ...
let $e_default = $m_LDefault$();
export { $e_default as default };
// ...
$c_LDefault$.prototype.scheduled = (function(arg, arg$2, arg$3) {
return this.scheduled__sjs_js_Object__sjs_js_Object__LCtx__sjs_js_Promise(arg, arg$2, arg$3);
});
var $d_LDefault$ = new $TypeData().initClass($c_LDefault$, "Default$", ({
LDefault$: 1
}));
var $n_LDefault$;
function $m_LDefault$() {
if ((!$n_LDefault$)) {
$n_LDefault$ = new $c_LDefault$();
}
return $n_LDefault$;
}
// ...
let $e_default = $m_LDefault$();
export { $e_default as default };
1 replies