Maze error - paginated message
I am getting this on a paginated message
35 Replies
list your dependencies please
I cannot reproduce the issue. Make sure your dependencies are properly installed by removing your lockfile and node_modules then reinstalling. Also make sure if you're using TypeScript that you remove your compiled files and recompile.
One moment I will try
Hmm still the same with yarn install
and after wiping all
yarn version?
yarn version v1.22.19
info Current version: 1.0.0
hmm, this seems really old?
Yarn v3 is new version of Yarn that we recommend switching to as Yarn v1 has been deprecated.
"But I don't see any update on [source]?"That is correct. Yarn v3 is installed through Yarn itself. Your global toolchain is and will always remain to be Yarn v1, however, you configure Yarn v3 on a per-project basis. How? Simply write: This will download the new Yarn v3 binary and put in
.yarn/releases
, you should push this to your Git repository. It will also create a .yarnrc.yml
file which configures the path which you should also commit.
Next you probably also want to run the following 2 commands:
This will add to your .yarnrc
file:
Which ensures that you just have a Yarn v1-like experience with node_modules
and a global cache.
Next step is to nuke your node_modules
and yarn.lock
and run yarn install
Then some final adjustments. Put this in you .gitignore
:
And anywhere in your scripts in package.json where you use *
you should wrap it in extra "
For example:
Mind you this last thing is good add regardless of script runner / package bundler because it ensures the glob is performed by the library and not by your shell, which may differ when people develop on different operating systems.
In short the command to set everything up you can run:
v4*, same steps tho
so it should still be berry?
yes
ah I see thank you
I just did all this thank you, but I still get the same error, so I will try troubleshoot more
The whole file is
FWIW the error should only occur when you run into an uncaught and unexpected error so something you're doing is going really wrong.
FYI you dont need to specify types in JSDoc when you write TS. Also
creditsBuilder
doesn't return an EmbedBuilder
anywayIs there a way to get more error logging?
Cause nothing shows up in console
Doing this works
so I assume it's something I do with the PaginatedMessage that's causing an issue
add a breakpoint in the files in node_modules/@sapphire/discord.js-utilities/dist/index.js and run with a debugger
well yeah that's where the error comes from https://github.com/sapphiredev/utilities/blob/8344b91a901b7bb4b2d7e4b97375268c60501483/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessage.ts#L242
GitHub
utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/P...
Common JavaScript utilities for Sapphire Projects. Contribute to sapphiredev/utilities development by creating an account on GitHub.
Given https://github.com/favna/musical-giggle/blob/issue/lewdslime-maze-is-not-meant-for-you/src/commands/chat-input-commands/sub.ts I cannot repro the issue
GitHub
musical-giggle/src/commands/chat-input-commands/sub.ts at issue/lew...
Contribute to favna/musical-giggle development by creating an account on GitHub.
and my dependancies looked fine?
Solution
I replicated them 1:1, see last commit on the branch
ohh yeah
I am going to check out my scripts, and bundling stuff I do as I have some scripts to bundle the json files
so I assume it may be causing some chaotic stuff there
I will copy your package.json exactly and see if it works
gl
But yeah I think this issue can be marked as resolved, as it works when you reproduce
I will investigate on my end
regarding bundling json, not sure what build tool you use but if you use regular
tsc
you can just have them be moved to dist by including them, i.e. src/**/*.json
and resolveJsonModules
to trueI was using tsup
ah
that should work too
Hmm, even with normal package it doesn't work so yeah there is something going wrong somewhere else I will try to troubleshoot but I will recreate the entire project, thank you!
what I recommend is setting that breakpoint just before the error is thrown, I linked the line above but you'll have to do a bit of searching (control+f is your friend) in the JS file because it's compiled code. Once on the breakpoint you can check the stack to see where it was called from and work your way upward from there. You should find it quite fast enough.
So I am trying to debug it but how would I know exactly where the problem is?
It doesn't seem obvious at a glaring point, like
not sure if it's this but it seems to be related I think
didnt get back to you before @Slime. I can try and debug it for you but you'll have to send me your code but preferebly in a minimal way. I.e. no database (just cumbersome for me to set up) and only the one command. Also make sure you absolutely include a package lock file (
package-lock.json
, yarn.lock
, etc) so I can be sure to install the same dependencies as you.It worked with adding intents
So I should have read the docs for that one, I realized by debugging it
So it's all good now, I just had some issues setting up the debugging.
oh ok
so you were missing the guilds intent then?
I didn't have any intents at all but I added the most common ones that I'll think I need but guilds was one of them
so adding the intents helped but not sure which one actually solved it
guilds for sure considering that's the only one @Dragonite has and it works just fine
just try /pokemon for example