Skip to content

🐛 BUG: Usage of "typeof module" causes error "The uploaded script has no registered event handlers. [code: 10068]" #1668

@paul-go

Description

@paul-go

What version of Wrangler are you using?

2.0.25

What operating system are you using?

Mac

Describe the Bug

Attempting to deploy the following code causes the error:
"The uploaded script has no registered event handlers. [code: 10068]"

"use strict";
addEventListener("fetch", () => { });
typeof module;

Commenting out the last line causes the deployment to function as expected:

"use strict";
addEventListener("fetch", () => { });
//typeof module;

EDIT: Seems the same thing is happening if I change the variable after typeof to exports. Is this thing specifically trying to prevent me from detecting Node.js vs Cloudflare?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions