# \[bug report\] dfx auto-gen \`\<canister\>\`.d.ts wrong naming

**URL:** <https://forum.dfinity.org/t/bug-report-dfx-auto-gen-canister-d-ts-wrong-naming/4468>\
**Category:** Developers\
**Created:** [May 28, 2021, 4:20am UTC](https://forum.dfinity.org/t/bug-report-dfx-auto-gen-canister-d-ts-wrong-naming/4468 "2021-05-28T04:20:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hackape](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hackape/32/1165_2.png) [@hackape](https://forum.dfinity.org/u/hackape)\
**Post date:** [May 28, 2021, 4:20am UTC](https://forum.dfinity.org/t/bug-report-dfx-auto-gen-canister-d-ts-wrong-naming/4468/1 "2021-05-28T04:20:21Z")

</div>

Version: `dfx 0.7.0-beta.8`

When `dfx build` a canister, let’s say it’s aliased as `my_app`, dfx output a set of files under the `.dfx/local/canisters/my_app/` directory, the tree looks like:

```auto
my_app
├── my_app.did
├── my_app.wasm
├── my_app.did.js
├── my_app.d.ts # <- this one got the wrong name!
└── my_app.js

```

`my_app.d.ts` should really be named `my_app.did.d.ts` since it contains types for the `my_app.did.js`, not `my_app.js`. It’s crucial because typescript engine need the correct name to do mapping, else I got false alarm in my IDE.

I would open an issue if `dfx` had its own repo but it does not. cc @anon74414410

---

<div class="post-metadata">

**Author:** ![hackape](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hackape/32/1165_2.png) [@hackape](https://forum.dfinity.org/u/hackape)\
**Post date:** [May 28, 2021, 6:27am UTC](https://forum.dfinity.org/t/bug-report-dfx-auto-gen-canister-d-ts-wrong-naming/4468/2 "2021-05-28T06:27:04Z")

</div>

One more thing. Take for example this auto-gen `greeting.d.ts` file.

```auto
export interface Greeting {
  hello: () => Promise<string>;
}

export default Greeting;

```

The default export here is just a interface, not a value. But the real `greeting.did.js` default exports a value. The correct typing should be:

```auto
var Greeting: Greeting; // declare variable (it's ok to take same name)
export default Greeting; // export the variable, not interface

```

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [May 28, 2021, 5:21pm UTC](https://forum.dfinity.org/t/bug-report-dfx-auto-gen-canister-d-ts-wrong-naming/4468/3 "2021-05-28T17:21:19Z")

</div>

Not my neck of the woods, but I’ve filed an issue on the internal repo. Thanks for diagnosing and reporting the bug!

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [July 17, 2021, 1:05am UTC](https://forum.dfinity.org/t/bug-report-dfx-auto-gen-canister-d-ts-wrong-naming/4468/4 "2021-07-17T01:05:19Z")

</div>

It took a bit, but this is resolved in dfx 0.7.7. Thanks again for bringing this up!
