Skip to content

Support for Deno #17

@rhamzeh

Description

@rhamzeh

Currently, the axios dependency causes issues when attempting to run the SDK from Deno

Deno 1.41.1
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import {OpenFgaClient} from "https://dev.jspm.io/@openfga/sdk"
undefined
> const fgaClient = new OpenFgaClient({ apiUrl: "https://api.playground.fga.dev" })
undefined
> fgaClient.createStore({ name: "test-deno-store" })
Promise {
  <rejected> AxiosError: There is no suitable adapter to dispatch the request since :
- adapter xhr is not supported by the environment
- adapter http is not available in the build
    at Object.getAdapter (https://dev.jspm.io/npm:[email protected]!cjs:2123:13)
    at Axios.dispatchRequest (https://dev.jspm.io/npm:[email protected]!cjs:2162:28)
    at Axios.request (https://dev.jspm.io/npm:[email protected]!cjs:2470:33)
    at wrap (https://dev.jspm.io/npm:[email protected]!cjs:8:15)
    at https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:675:24
    at Generator.next (<anonymous>)
    at https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:572:69
    at new Promise (<anonymous>)
    at __awaiter (https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:554:12)
    at attemptHttpRequest (https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:670:12) {
    name: "FgaApiError",
    statusCode: undefined,
    statusText: undefined,
    requestData: undefined,
    requestURL: undefined,
    method: undefined,
    storeId: "",
    endpointCategory: "",
    apiErrorMessage: undefined,
    responseData: undefined,
    responseHeader: undefined,
    requestId: undefined
  }
}
Uncaught AxiosError: There is no suitable adapter to dispatch the request since :
- adapter xhr is not supported by the environment
- adapter http is not available in the build
    at Object.getAdapter (https://dev.jspm.io/npm:axios@1.6.2!cjs:2123:13)
    at Axios.dispatchRequest (https://dev.jspm.io/npm:axios@1.6.2!cjs:2162:28)
    at Axios.request (https://dev.jspm.io/npm:axios@1.6.2!cjs:2470:33)
    at wrap (https://dev.jspm.io/npm:axios@1.6.2!cjs:8:15)
    at https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:675:24
    at Generator.next (<anonymous>)
    at https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:572:69
    at new Promise (<anonymous>)
    at __awaiter (https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:554:12)
    at attemptHttpRequest (https://dev.jspm.io/npm:@openfga/[email protected]/_/F1S5_afg.js:670:12)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions