Skip to content

[api-extractor] Error: Symbol not found for identifier: WebAssembly #1370

Closed

Description

May be related to #1304 – I'm trying:

bitcoin-ts $ yarn
bitcoin-ts $ yarn build
bitcoin-ts $ api-extractor run --local --verbose

api-extractor 7.3.0  - https://api-extractor.com/

Using configuration from /[...]/bitcoin-ts/api-extractor.json

Error: Symbol not found for identifier: WebAssembly

The repo is bitauth/bitcoin-ts, and the only non-default configuration is: "mainEntryPointFilePath": "<projectFolder>/build/main/index.d.ts",.

Any ideas for how to correct this? Thanks!

Activity

  1. changed the title [-]Error: Symbol not found for identifier: WebAssembly[/-] [+][api-extractor] Error: Symbol not found for identifier: WebAssembly[/+] on Jul 10, 2019
  2. iclanton commented on Jul 10, 2019

    @iclanton
    Member

    Do you have the typings for WebAssembly referenced in your tsconfig.json?

  3. bitjson commented on Jul 10, 2019

    @bitjson
    Author

    Ian Clanton-Thuon (@iclanton) thanks for the quick response. Yes –"lib" is currently set to [ "es2017", "esnext.bigint", "dom" ], and the WebAssembly namespace is now in lib.dom.d.ts. (A recent development – previously separate in @types/webassembly-js-api.)

    Is there a better way to generate debug logs or a more verbose error message?

  4. octogonz commented on Jul 11, 2019

    @octogonz
    Collaborator

    Is there a better way to generate debug logs or a more verbose error message?

    Yes, you can do api-extractor run --local --diagnostics.

    Error: Symbol not found for identifier: WebAssembly

    I cannot repro this error. I did this:

    1. Clone bitauth/libauth@cd8f44d
    2. Run api-extractor init using 7.3.0
    3. Edit mainEntryPointFilePath as you said.
    4. Run api-extractor run --local --diagnostics

    It generated the rollup and API report just fine. I am using NodeJS 10.13.0 on Windows 10.

    Jason Dreyzehner (@bitjson) could you provide more specific repro steps?

  5. bitjson commented on Jul 11, 2019

    @bitjson
    Author

    Ah, very sorry, I thought I had also reproduced the issue on the master branch. I just pushed an api-extractor branch where I'm getting the error. Thanks for your help!

  6. bitjson commented on Jul 11, 2019

    @bitjson
    Author

    Ok, after trying the --diagnostics flag, the issue is definitely that it's using the version of lib.dom.d.ts from typescript v3.4.5 (node_modules/@microsoft/api-extractor/node_modules/typescript/lib/lib.dom.d.ts), but my project is built with that from 3.5.3 (node_modules/typescript/lib/lib.dom.d.ts). The WebAssembly namespace was added to lib.dom.d.ts in microsoft/TypeScript@1e7482a, which didn't get released until v3.5.1.

    I see some info in the documentation about IExtractorInvokeOptions.typescriptCompilerFolder. That sounds like what I need to adjust, but I'm not sure if I understand how – can that be set in api-extractor.json? (I don't see it in the schema.)

  7. octogonz commented on Jul 11, 2019

    @octogonz
    Collaborator

    Ok, after trying the --diagnostics flag, the issue is definitely that it's using the version of lib.dom.d.ts from typescript v3.4.5

    Awesome! PR #1359 paid off after just a few days. :-D

  8. octogonz commented on Jul 11, 2019

    @octogonz
    Collaborator

    The WebAssembly namespace was added to lib.dom.d.ts in microsoft/TypeScript@1e7482a, which didn't get released until v3.5.1.

    The right fix is for us to upgrade API Extractor's TypeScript compiler.

    I see some info in the documentation about IExtractorInvokeOptions.typescriptCompilerFolder. That sounds like what I need to adjust, but I'm not sure if I understand how – can that be set in api-extractor.json?

    It's a command-line option --typescript-compiler-folder. You can use that as a workaround.

  9. octogonz commented on Jul 11, 2019

    @octogonz
    Collaborator

    Here's a PR: #1372

  10. added
    bugSomething isn't working as intended
    and removed
    needs more infoWe can't proceed because we need a better repro or an answer to a question
    on Jul 11, 2019
  11. bitjson commented on Jul 11, 2019

    @bitjson
    Author

    Pete Gonzalez (@octogonz) not sure how I didn't realize it was a CLI option – working well now, thanks! (And thanks for the fantastic project! Looking forward to building out my documentation with this.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions