denoland / denoland/deploy_feedback

[Bug]: Worker is not defined

Open
#822 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### Problem description

I am creating workers for slow background tasks locally Deno is working properly. When deploying it says "Worker is not defined"
Do I have to do something special to activate Workers for deployment?

### Steps to reproduce

// main.ts
const worker = new Worker(new URL("./worker.ts", import.meta.url).href, {
type: "module",
});
// worker.ts
self.onmessage = async (event: MessageEvent) => {
const { url, id } = event.data;
logger.info(`Worker started for ${id}`
self.postMessage({ id });
};

### Expected behavior

No error during deployment

### Environment

**Deno:**
deno 2.1.9 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2
**System WSL:**
5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

### Possible solution

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the deployment using the reported main.ts and worker.ts examples, then compare its runtime environment with local Deno. Reproduce the Worker is not defined error and inspect the deployment entry point or runtime documentation available for this project. Done means the deployment behavior is clarified and the reported worker usage either works without the error or has an explicit documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.