I'm trying to implement paths into ts, in VSCODE it seems to be fine without errors but when I compiling it.. It gives error:
-src/index.ts:1:51 - error TS2307: Cannot find module '@EXPORT_MODULES' or its corresponding type declarations.
import { Client, Events, GatewayIntentBits } from '@EXPORT_MODULES';
tsconfig.json
{
"ts-node": {
"require": ["tsconfig-paths/register"]
},
"compilerOptions": {
"lib": ["es5", "es6", "es7"],
"target": "es2017",
"module": "commonjs",
"moduleResolution": "node",
"rootDir": "src",
"outDir": "build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"noImplicitAny": true,
"strict": true,
"resolveJsonModule": true,
"allowJs": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@INDEX_ROOT": ["src/index"],
"@HANDLERS_ROOT*": ["src/handlers*"],
"@EXPORT_MODULES": ["src/export"],
},
},
"include": ["src/**/*"],
"exclude": [
"node_modules"
],
}
src/export.ts
export { SlashCommandBuilder, Client, Collection, Events, GatewayIntentBits } from 'discord.js';
export { glob } from 'glob-promise';
src/index.ts
import { Client, Events, GatewayIntentBits } from '@EXPORT_MODULES';
import { registerCommands } from '@HANDLERS_ROOT/registerCommands';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const commands = registerCommands(client);
client.once(Events.ClientReady, c => {
console.log(`Ready! Logged in as ${c.user.tag}`);
console.log(commands);
});
client.login(process.env.DTOKEN);
I need help with MODULES not with discord