Skip to content

Uncaught TypeError: 'JSArray' is not a subtype of type 'List<ResizeObserverEntry>' #1026

Closed
@kenzieschmoll

Description

@kenzieschmoll

I have some resize observer code that looks as follows:

    final observer = html.ResizeObserver(allowInterop((entries, _) {
       // do something
    }));
    observer.observe(element);

And in the dart2js version of the web app, I am getting a TypeError. I do not get this error when using webdev serve.

Uncaught TypeError: Instance of 'JSArray': type 'JSArray' is not a subtype of type 'List<ResizeObserverEntry>'
    at Object.wrapException (main.dart.js:1115)
    at Object.assertSubtype (main.dart.js:1975)
    at EventDetails_closure.call$2 (main.dart.js:42132)
    at Object.Primitives_applyFunction (main.dart.js:1001)
    at Object.Function_apply (main.dart.js:5440)
    at _callDartFunctionFast (main.dart.js:7374)
    at main.dart.js:7365
    at Function.call$2 (main.dart.js:54318)
    at invokeClosure (main.dart.js:1307)
    at ResizeObserver.<anonymous> (main.dart.js:1325)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions