#error translation

16 messages · Page 1 of 1 (latest)

spark ridge
#

**error TS2322: Type 'string' is not assignable to type 'ApplicationCommandType.ChatInput'.

7 type: "CHAT_INPUT",
~~~~

../node_modules/discord.js/typings/index.d.ts:4318:3
4318 type?: ApplicationCommandType.ChatInput;
~~~~
The expected type comes from property 'type' which is declared here on type 'Command'**

solid cosmos
#

@spark ridge Showing the actual code causing the error and not just the error would be necessary for someone to help.

#

You can format code like:

```ts
// code here

spark ridge
#

@solid cosmos update:

here's another error i got
**config.ts:1:10 - error TS2305: Module '"dotenv"' has no exported member 'dotenv'.

1 import { dotenv } from "dotenv";**

and here's the code

import { dotenv } from "dotenv";

dotenv.config();

const { DISCORD_TOKEN, DISCORD_CLIENT_ID } = process.env;

if (!DISCORD_TOKEN || !DISCORD_CLIENT_ID) {
  throw new Error("Missing environment variables");
}

export const config = {
  DISCORD_TOKEN,
  DISCORD_CLIENT_ID,
};
strange bolt
#
#

@spark ridge

#

you used the wrong syntax

#
import * as dotenv from "dotenv";

not

import { dotenv } from "dotenv";
spark ridge
#

@strange bolt i changed it to that and got even more errors we are currently discussing this in #ts-discussion plz join in thank you

strange bolt
#

resolved, I guess? 🤔

spark ridge
strange bolt
#

!resolved

nocturne zephyrBOT
#

@spark ridge
Because your issue seemed to be resolved, this post was marked as resolved by @strange bolt.
If your issue is not resolved, you can reopen this post by running !reopen.
If you have a different question, make a new post in #1057653400046674112.

spark ridge
#

okay