Skip to content

Error if requestConfig.args are given via function #44

Description

@kenwenzel

I use

requestConfig: {
    endpoint: window.location.origin + "/sparql",
    args: (yasqe) => {
        return [{ name: "model", value: $('#model').val() }];
    }
}

to dynamically set the argument model before executing a query.

When a new tab is created the error

Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.

occurs due to the following line:

https://github.com/zazuko/Yasgui/blob/919d19719036e47a3dcd89bb839230e6741c33d8/packages/yasgui/src/Tab.ts#L323

The exception occurs because srcValue is the value returned by the above args function while objValue is the function itself.
Maybe the checks must be combined by && instead of ||?

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions