Issue 1:
@kitsonk @ry @bartlomieju submitting a separate issue brought up by @base698 in #3828

worker.ts

function entryPoint(data) {
console.log('received');
postMessage("Hi 2 u");
}

if (self.name !== "workerFn") throw Error("Bad name");

onmessage = function(e) {
entryPoint(e.data);
}

onerror = function(err) {
console.error('on error', err);
return false;
}

01_worker.ts

var [diagnostics, emit] = await Deno.bundle('./worker.ts');
const encoder = new TextEncoder();
Deno.writeFileSync('./worker.js', encoder.encode(emit));

const workerFn = new Worker('./worker.js', { name: 'workerFn', type: "module" });
workerFn.onmessage = console.log;

workerFn.postMessage('from client');

Deno 0.32

$ deno --allow-write 01_worker.ts
received
{ data: "Hi 2 u" }

Deno 0.33

$ deno --allow-write 01_worker.ts
Compile file:///home/justin/workspaces/deno-test/tests/01_worker.ts
error: Uncaught Error: Uncaught TypeError: Cannot destructure property 'deps' of 'mMap.get(...)' as it is undefined.
$deno$/workers.ts:169:17
at poll ($deno$/workers.ts:169:17)

Issue 2:
deno 0.33.0
v8 8.1.108
typescript 3.7.2

I tried to bundle a file with content code:

console.log('Hello from Deno!');

to bundle: deno bundle app.ts bundle.js

it generated :

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.

// This is a specialised implementation of a System module loader.

// eslint-disable-next-line @typescript-eslint/no-unused-vars
let System;
let __inst;

(() => {
const mMap = new Map();
System = {
register(id, deps, f) {
mMap.set(id, {
id,
deps,
f,
exp: {}
});
}
};

const gC = (data, main) => {
const { id } = data;
return {
id,
import: async id => mMap.get(id)?.exp,
meta: { url: id, main }
};
};

const gE = data => {
const { exp } = data;
return (id, value) => {
const values = typeof id === "string" ? { [id]: value } : id;
for (const [id, value] of Object.entries(values)) {
Object.defineProperty(exp, id, {
value,
writable: true,
enumerable: true
});
}
};
};

const iQ = [];

const enq = ids => {
for (const id of ids) {
if (!iQ.includes(id)) {
const { deps } = mMap.get(id);
iQ.push(id);
enq(deps);
}
}
};

const dr = async main => {
const rQ = [];
let id;
while ((id = iQ.pop())) {
const m = mMap.get(id);
const { f } = m;
if (!f) {
return;
}
rQ.push([m.deps, f(gE(m), gC(m, id === main))]);
m.f = undefined;
}
let r;
while ((r = rQ.shift())) {
const [deps, { execute, setters }] = r;
for (let i = 0; i < deps.length; i++) setters[i](mMap.get(deps[i])?.exp);
const e = execute();
if (e) await e;
}
};

__inst = async id => {
System = undefined;
__inst = undefined;
enq([id]);
await dr(id);
return mMap.get(id)?.exp;
};
})();

console.log('Hello from Deno!');

await __inst("file:///C:/Users/SOstad/Projects/tests/deno01/src/app");

after I run it with deno run bundle.js here is the error:

error: Uncaught TypeError: Cannot destructure property 'deps' of 'mMap.get(...)' as it is
undefined.

also Docs for bundle is outdated:

Bundling

deno bundle [URL] will output a single JavaScript file, using AMD, which includes all dependencies of the specified input.

> deno bundle https://deno.land/std/examples/colors.ts
Bundling "colors.bundle.js"
Emitting bundle to "colors.bundle.js"
9.2 kB emitted.

To run then bundle in Deno use

deno https://deno.land/std/bundle/run.ts colors.bundle.js

Bundles can also be loaded in the web browser with the assistance of RequireJS. Suppose we have a bundle called website.bundle.js, then the following HTML should be able to load it:

<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script src="website.bundle.js"></script>
<script>
requirejs(["website"], website => website.main());
</script>

Here we assume there's an exported function main() from website.ts.

// website.ts
export main() {
console.log("hello from the web browser");
}