Skip to content

Dart2JS interop breaks if there are no classes annotated with @JS #37576

@natebosch

Description

@natebosch

Was trying to reproduce a different issue and was unable to use js iterop at all until I had some class annotated with @JS() regardless of wether that class was used.

VM362 main.dart.js:1001 Uncaught TypeError: v.getIsolateTag is not a function
    at VM362 main.dart.js:1001
    at Object.a.<computed> (VM362 main.dart.js:27)
    at Object.bh (VM362 main.dart.js:617)
    at Object.bk (VM362 main.dart.js:626)
    at Object.aX (VM362 main.dart.js:628)
    at VM362 main.dart.js:1013
    at VM362 main.dart.js:1008
    at dartProgram (VM362 main.dart.js:1011)
    at VM362 main.dart.js:1013

So, for instance, if I only have top level methods annotated then getIsolateTag function is not written and the interop does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2jsweb-js-interopIssues that impact all js interop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions