Closed ricky8k closed 8 months ago
Yeah, I've been noticed about this by another team member of the project yesterday. Same as you, I'm still unable to use the loader thingy. I can't understand a thing from the docs.
For now, you can use the fix you detailed in your issue as a workaround while we try to fix this.
This should be fixed with the latest commit I did.
This should be fixed with the latest commit I did.
I appreciate your time on fixing this issue. Unfortunately, I'm still unable to run Rawon on the latest commit. I ran a new install of Rawon with Node v20.10.0
and v20.11.0
(latest LTS) and was unable to start it:
user@mihari:~/rawon$ npm start
> rawon@3.2.1 start
> node --es-module-specifier-resolution=node -r dotenv/config .
[INFO] Couldn't find FFmpeg/avconv, trying to install ffmpeg-static...
[INFO] ffmpeg-static has been installed.
[INFO] Starting the bot...
[2024-01-13 20:51:54 (-05)] [info]: [ShardManager] Shard #0 has spawned.
[2024-01-13 20:51:54 (-05)] [info]: [ShardManager] All shards are spawned successfully.
[2024-01-13 20:51:58 (-05)] [info]: Loading 10 events...
[2024-01-13 20:51:59 (-05)] [info]: Events on listener channelUpdate has been added.
[2024-01-13 20:51:59 (-05)] [info]: Events on listener debug has been added.
[2024-01-13 20:51:59 (-05)] [info]: Events on listener error has been added.
[2024-01-13 20:51:59 (-05)] [info]: Events on listener guildBanAdd has been added.
[2024-01-13 20:51:59 (-05)] [info]: Events on listener guildBanRemove has been added.
[2024-01-13 20:51:59 (-05)] [info]: Events on listener interactionCreate has been added.
[2024-01-13 20:51:59 (-05)] [info]: Events on listener messageCreate has been added.
[2024-01-13 20:51:59 (-05)] [error]: EVENTS_LOADER_ERR: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './locale/index.js' is not defined by "exports" in /home/user/rawon/node_modules/date-fns/package.json imported from /home/user/rawon/dist/utils/functions/formatMS.js
[2024-01-13 20:51:59 (-05)] [info]: Done loading events.
I did manage to fix the event load error it by reverting the const declaration change for locales
in src/formatMS.js
from the recent commits (https://github.com/ricky8k/rawon/commit/b7bcf95bde8502451501de7741e4616831dacbc0). Unfortunately, my fix isn't completely stable. Sometimes, Rawon will stall after loading events:
user@mihari:~/rawon$ npm start
> rawon@3.2.1 start
> node --es-module-specifier-resolution=node -r dotenv/config .
[INFO] Starting the bot...
[2024-01-13 21:05:29 (-05)] [info]: [ShardManager] Shard #0 has spawned.
[2024-01-13 21:05:29 (-05)] [info]: [ShardManager] All shards are spawned successfully.
[2024-01-13 21:05:33 (-05)] [info]: Loading 10 events...
[2024-01-13 21:05:33 (-05)] [info]: Events on listener channelUpdate has been added.
[2024-01-13 21:05:33 (-05)] [info]: Events on listener debug has been added.
[2024-01-13 21:05:33 (-05)] [info]: Events on listener error has been added.
[2024-01-13 21:05:33 (-05)] [info]: Events on listener guildBanAdd has been added.
[2024-01-13 21:05:33 (-05)] [info]: Events on listener guildBanRemove has been added.
[2024-01-13 21:05:33 (-05)] [info]: Events on listener interactionCreate has been added.
[2024-01-13 21:05:33 (-05)] [info]: Events on listener messageCreate has been added.
[2024-01-13 21:05:35 (-05)] [info]: Events on listener ready has been added.
[2024-01-13 21:05:35 (-05)] [info]: Events on listener voiceStateUpdate has been added.
[2024-01-13 21:05:35 (-05)] [info]: Events on listener warn has been added.
[2024-01-13 21:05:35 (-05)] [info]: Done loading events.
When it wasn't stalled, it loaded the necessary commands and Rawon would work without issue. From what I could observe, it boots properly about 5 minutes after Rawon is stopped.
Thanks for the report, I just fixed it. Try it again.
Rawon works without a problem now. Thank you!
Describe the bug
Since commit https://github.com/stegripe/rawon/pull/1335/commits/24636b0f25f8b776c3554cc36fd2255485b38536, Rawon uses
got
version14.0.0
. This dependency requires a version of Nodev20.x.x
or above:At the moment, I'm unsure whether this will become a major issue for Rawon's core functionality. I currently use Rawon as a private music bot for my servers, and the bot continues to operate as expected under Node
v18.17.1
with the unsupported dependency.However, I did try to install using the latest LTS version of Node (
v20.10.0
) to see if it would be resolved. Installinggot
seems to no longer provide an error, but now Rawon refuses to start:Based on the fix reported in https://github.com/stegripe/rawon/issues/1338, it seems that you now need to explicitly define ES modules down to the main file in order to import directories properly.
In my limited testing, I've had to change two files to get Rawon running:
dist/utils/functions/formatMS.js
- Line 3, needs to beimport * as locales from "date-fns/locale/index.js";
index.js
- Line 1, needs to beimport { downloadExecutable } from "./yt-dlp-utils/index.js";
There may be more files that need to be changed to fix core functions. I'm unsure whether Rawon utilizes the
--experimental-specifier-resolution
for Node, which looks like it was removed inv19
and above. As a result of being onv20
, I tried to use a custom loader to fix the issue. Unfortunately, my knowledge in Node.js is very limited and I was unable to get it working.I hope I've managed to provide enough context to the issue!
To Reproduce
v20.10.0
(presumably anythingv19.x.x
or later as well, though this is unconfirmed)npm start
ornpm run start
Expected behavior
Rawon should be able to run without issue.
Screenshots
No response
Operating System
Debian 11 (aarch64)
Additional context
No response