Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript compile error during bundle gives unhelpful assertion error #5507

Closed
Ragzouken opened this issue May 16, 2020 · 7 comments · Fixed by #5603
Closed

Typescript compile error during bundle gives unhelpful assertion error #5507

Ragzouken opened this issue May 16, 2020 · 7 comments · Fixed by #5603
Assignees
Labels
bug Something isn't working correctly

Comments

@Ragzouken
Copy link

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)
@bartlomieju
Copy link
Member

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

@bartlomieju bartlomieju self-assigned this May 16, 2020
@bartlomieju bartlomieju added the bug Something isn't working correctly label May 16, 2020
@paskausks
Copy link

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 9d63772 (the commit which merges #5029 ) and from the master branch. TypeScript source at v3.9.2 if that helps.

@bartlomieju
Copy link
Member

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

@paskausks
Copy link

@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"
  ]
}

@paskausks
Copy link

paskausks commented May 18, 2020

@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.

@bartlomieju
Copy link
Member

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

@davidcallanan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants