Есть наработки для бота:
https://github.com/Gospodin116/discordjs-bot-ts.
При компиляции
npm run dev
всё нормально. Но как запускаю
npm run start
, то выводит ошибку
[MODULE_NOT_FOUND]
.
Сама ошибка:
webpack://ac_community/./node_modules/discord.js/src/client/actions/_sync_^\.\/.*$?:111
throw e;
^
Error: Cannot find module './index.js'
at webpackContextResolve (webpack://ac_community/./node_modules/discord.js/src/client/actions/_sync_^\.\/.*$?:109:11)
at webpackContext (webpack://ac_community/./node_modules/discord.js/src/client/actions/_sync_^\.\/.*$?:104:11)
at new ActionsManager (webpack://ac_community/./node_modules/discord.js/src/client/actions/ActionsManager.js?:13:114)
at new Client (webpack://ac_community/./node_modules/discord.js/src/client/Client.js?:100:20)
at eval (webpack://ac_community/./src/index.ts?:2:14)
at Object../src/index.ts (C:\Dev\Bots\discord\ac_community\dist\index.js:4087:1)
at __webpack_require__ (C:\Dev\Bots\discord\ac_community\dist\index.js:4518:42)
at C:\Dev\Bots\discord\ac_community\dist\index.js:4575:37
at Object.<anonymous> (C:\Dev\Bots\discord\ac_community\dist\index.js:4577:12)
at Module._compile (node:internal/modules/cjs/loader:1109:14) {
code: 'MODULE_NOT_FOUND'
Я определил, что ошибка начиналась с данного метода:
client.once('ready', () => {
console.log('Ready!');
});
Но так и не пойму, что я делаю не так.
PS: используются TS, Webpack, discordjs.