Deno: Typescript compile error during bundle gives unhelpful assertion error

Created on 16 May 2020  路  7Comments  路  Source: denoland/deno

In this case, I forgot to pass -c tsconfig.json to add DOM to the libs. I'm assuming this should be instead outputting the compile errors.

PS C:\Users\mark\Documents\PROJECTS\deno-test> deno --version
deno 1.0.0
v8 8.4.300
typescript 3.9.2
PS C:\Users\mark\Documents\PROJECTS\deno-test> deno bundle ./src/index.ts
Bundling file:///C:/Users/mark/Documents/PROJECTS/deno-test/src/index.ts
error: Uncaught AssertionError: Assertion failed.
    at Object.assert ($deno$/util.ts:33:11)
    at compile ($deno$/compiler.ts:1355:5)
    at async tsCompilerOnMessage ($deno$/compiler.ts:1548:22)
    at async workerMessageRecvCallback ($deno$/runtime_worker.ts:74:9)
bug

Most helpful comment

@Ragzouken thanks for the issue, I just discovered it myself and it will be fixed in #5029

All 7 comments

@Ragzouken thanks for the issue, I just discovered it myself and it will be fixed in #5029

Yeah, that seemed to fix it, but now i'm getting:

error: missing field `bundleOutput` at line 1 column 69284

That's from building from 9d63772f (the commit which merges #5029 ) and from the master branch. TypeScript source at v3.9.2 if that helps.

@paskausks thanks for a catch, can you provide full command you run?

@bartlomieju .\target\release\deno.exe bundle -c tsconfig.json index.ts index.js

The tsconfig is:

{
  "compilerOptions": {
    "lib": [ "DOM", "ES6", "DOM.Iterable", "ScriptHost"],
    "strict": true,
    "esModuleInterop": true
  },
  "exclude": [
      "public"
  ]
}

@bartlomieju found the issue which caused this (the same which caused the AssertionError initially) - an import from my emotion reexport.

from index.ts:

import { css } from "./emotion.js";

and emotion.js

// @deno-types=https://github.com/emotion-js/emotion/blob/v10.0.6/packages/emotion/types/index.d.ts
export * from 'https://unpkg.com/[email protected]/dist/emotion.esm.js?module';

For comparison - I have preact and htm re-exports and those work fine.

@paskausks thanks for repro, I'll look into it.

I'm getting this same error, but haven't created a reproduction yet

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyeotic picture kyeotic  路  3Comments

doutchnugget picture doutchnugget  路  3Comments

sh7dm picture sh7dm  路  3Comments

ry picture ry  路  3Comments

JosephAkayesi picture JosephAkayesi  路  3Comments