# Generate js bindings from remote did

**URL:** <https://forum.dfinity.org/t/generate-js-bindings-from-remote-did/23909>\
**Category:** Developers\
**Created:** [October 20, 2023, 10:44am UTC](https://forum.dfinity.org/t/generate-js-bindings-from-remote-did/23909 "2023-10-20T10:44:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Dustin](https://forum.dfinity.org/u/Dustin)\
**Post date:** [October 20, 2023, 10:44am UTC](https://forum.dfinity.org/t/generate-js-bindings-from-remote-did/23909/1 "2023-10-20T10:44:22Z")

</div>

I’m declaring canisters in my repository as “custom” and define the url where to fetch them, in particular for the ICRC1 ledger indexer [deployment guide](https://internetcomputer.org/docs/current/developer-docs/integrations/icrc-1/icrc1-index-setup#step-4-configure-the-dfxjson-file).

The `dfx.json` file then looks like this

```auto
{
  "canisters": {
    "icrc1_index_canister": {
      "type": "custom",
      "candid": "https://raw.githubusercontent.com/dfinity/ic/d87954601e4b22972899e9957e800406a0a6b929/rs/rosetta-api/icrc1/index-ng/index-ng.did",
      "wasm": "https://download.dfinity.systems/ic/d87954601e4b22972899e9957e800406a0a6b929/canisters/ic-icrc1-index-ng.wasm.gz",
    },
    "icrc1_ledger_canister": {
      "type": "custom",
      "candid": "https://raw.githubusercontent.com/dfinity/ic/d87954601e4b22972899e9957e800406a0a6b929/rs/rosetta-api/icrc1/ledger/ledger.did",
      "wasm": "https://download.dfinity.systems/ic/d87954601e4b22972899e9957e800406a0a6b929/canisters/ic-icrc1-ledger.wasm.gz",
    }
  },
  "output_env_file": ".env",
  "version": 1
}

```

The deployment works fine and I would like to use `dfx generate` to create the `js` bindings for the candid. When I simply run `dfx generate` it throws me an error that it can’t find the `did` file in the `.dfx/local` folder. It makes sense because I didn’t deploy locally.

Is there a way to run `dfx generate` and create my `js` bindings without having to deploy locally? Can this work from the remote url directly?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [October 20, 2023, 11:11am UTC](https://forum.dfinity.org/t/generate-js-bindings-from-remote-did/23909/2 "2023-10-20T11:11:26Z")

</div>

That’s simply a bug. I can’t get it to work either. I suppose you could declare the canister non-remote,`dfx generate`, and then revert back to remote as a workaround. Alternatively you could try to generate the bindings yourself with [didc](https://github.com/dfinity/candid/releases). The command would be `didc bind --target js <did file>`

Note to self: [ticket](https://dfinity.atlassian.net/browse/SDK-1297)

---

<div class="post-metadata">

**Author:** ![Dustin](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Dustin](https://forum.dfinity.org/u/Dustin)\
**Post date:** [October 20, 2023, 11:33am UTC](https://forum.dfinity.org/t/generate-js-bindings-from-remote-did/23909/3 "2023-10-20T11:33:08Z")

</div>

Yeah, that’s what I did in the end. I define non-remote to generate the bindings.

Thanks! Good to know that this will be fixed soon.
