Deno: Uncaught ReferenceError when running bundle created with Deno 1.5.x

Created on 31 Oct 2020  路  5Comments  路  Source: denoland/deno

I'm getting runtime errors when executing bundles created with Deno 1.5.x that I didn't get in 1.4.6:

main.ts:

example % cat main.ts 
import * as luxon from 'https://unpkg.com/[email protected]/src/luxon.js';

Link to module for examination: https://unpkg.com/[email protected]/src/luxon.js

Bundling with 1.5.1:

example % deno --version
deno 1.5.1
v8 8.7.220.3
typescript 4.0.3

example % deno bundle main.ts main-1.5.1.bundle.js
Bundle file:///Users/jesse/example/main.ts
Check file:///Users/jesse/example/main.ts
Emit "main-1.5.1.bundle.js" (102.86KB)

example % deno run main-1.5.1.bundle.js 
error: Uncaught ReferenceError: Cannot access 'Zone' before initialization
class IANAZone extends Zone {
                       ^
    at file:///Users/jesse/example/main-1.5.1.bundle.js:2015:24

example %

Bundling with 1.5.0:

example % deno --version
deno 1.5.0
v8 8.7.220.3
typescript 4.0.3

example % deno bundle main.ts main-1.5.0.bundle.js
Bundle file:///Users/jesse/example/main.ts
Check file:///Users/jesse/example/main.ts
Emit "main-1.5.0.bundle.js" (102.88KB)

example % deno run main-1.5.0.bundle.js 
error: Uncaught ReferenceError: Cannot access 'Zone' before initialization
class IANAZone extends Zone {
                       ^
    at file:///Users/jesse/example/main-1.5.0.bundle.js:2015:24

example %

Bundling with 1.4.6:

example % deno --version
deno 1.4.6
v8 8.7.220.3
typescript 4.0.3

example % deno bundle main.ts main-1.4.6.bundle.js
Bundle file:///Users/jesse/example/main.ts
Emit "main-1.4.6.bundle.js" (200KB)

example % deno run main-1.4.6.bundle.js 

example %

Running the 1.4.6 bundle with 1.5.1:

example % deno --version               
deno 1.5.1
v8 8.7.220.3
typescript 4.0.3

example % deno run main-1.4.6.bundle.js 

example %

Any ideas?

bug cli fix available upstream 鈽濓笍

All 5 comments

cc @kdy1

It looks like this will be fixed by https://github.com/swc-project/swc/pull/1196 in the next Deno release. Is that right?

@jsejcksn yes, it should be available in 1.5.2 on Friday

@bartlomieju Can I close it, or do the project members keep issues open for housekeeping tasks like release notes compilation? (I don't see a label for "fixed" / "patched" / etc.)

We will ensure it is closed when the update to swc is merged (it isn't yet).

Was this page helpful?
0 / 5 - 0 ratings