Issue on upgrade to v4

On loading like any file (listeners and commands) it spits out a TypeError: import_discord2.Permissions is not a constructor error and doesn't load it.
Solution:
wait, i didn't update decorators
Jump to solution
19 Replies
Hyper
Hyper2y ago
@Helpers (i think i'm allowed to ping this based on the post guidelines)
24
242y ago
We're on djs 14, permissions doesn't exist (I think) it was changed kinda? It's a bit weird to ping directly after making your post though
Favna
Favna2y ago
Permissions is removed djs v14. Follow the djs v14 migration guide, update all your dependencies, and make sure to completely remove and rebuild any typescript output directory
Hyper
Hyper2y ago
I know I tried all that This is with the compiled code I get no errors on compiling
vladdy
vladdy2y ago
It looks like you have an older sapphire version compared to the djs one
Hyper
Hyper2y ago
Djs v14.7.0 I think What's the latest sapphire v14.0.0 supports
vladdy
vladdy2y ago
it should work whats your sapphire version
Hyper
Hyper2y ago
Weird 4.0.0
vladdy
vladdy2y ago
hm,mm can you nuke node_modules and reinstall
Hyper
Hyper2y ago
I also tried that I can try again thou h Delete compiled and node modules But I'll have to wait till after school Oh wait should I also delete package lock
vladdy
vladdy2y ago
might help
Hyper
Hyper2y ago
Error when loading '/home/container/projects/ClubTools/dist/listeners/utils/status.js': TypeError: import_discord2.Permissions is not a constructor
{
"name": "clubtools",
"version": "1.0.0",
"main": "dist/index.js",
"author": "HyperfireRS",
"license": "UNLICENSE",
"private": true,
"dependencies": {
"@prisma/client": "^4.8.1",
"@sapphire/decorators": "^4.3.8",
"@sapphire/discord-utilities": "latest",
"@sapphire/discord.js-utilities": "latest",
"@sapphire/fetch": "^2.4.1",
"@sapphire/framework": "4.0.0",
"@sapphire/plugin-api": "latest",
"@sapphire/plugin-logger": "latest",
"@sapphire/plugin-subcommands": "latest",
"@sapphire/prettier-config": "^1.4.3",
"@sapphire/stopwatch": "^1.4.1",
"@sapphire/time-utilities": "^1.7.5",
"@sapphire/ts-config": "^3.3.4",
"@sapphire/type": "^2.2.4",
"@sapphire/utilities": "^3.9.1",
"@typegoose/typegoose": "latest",
"@types/ms": "^0.7.31",
"@types/node": "^18.7.8",
"@types/ws": "^8.5.3",
"canvacord": "^5.4.8",
"colorette": "^2.0.19",
"discord-api-types": "^0.33.5",
"discord.js": "^14.7.1",
"dotenv-cra": "^3.0.2",
"got": "11.8.2",
"mongoose": "^6.5.2",
"node-superfetch": "0.2.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"prisma": "^4.8.1",
"reflect-metadata": "^0.1.13",
"tsc-watch": "^5.0.3",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/index.js",
"dev": "run-s build start",
"packages": "npm i",
"prod": "run-s packages dev",
"watch:start": "tsc-watch --onSuccess \"node ./dist/index.js\"",
"format": "prettier --write \"src/**/*.ts\""
},
"prettier": "@sapphire/prettier-config"
}
{
"name": "clubtools",
"version": "1.0.0",
"main": "dist/index.js",
"author": "HyperfireRS",
"license": "UNLICENSE",
"private": true,
"dependencies": {
"@prisma/client": "^4.8.1",
"@sapphire/decorators": "^4.3.8",
"@sapphire/discord-utilities": "latest",
"@sapphire/discord.js-utilities": "latest",
"@sapphire/fetch": "^2.4.1",
"@sapphire/framework": "4.0.0",
"@sapphire/plugin-api": "latest",
"@sapphire/plugin-logger": "latest",
"@sapphire/plugin-subcommands": "latest",
"@sapphire/prettier-config": "^1.4.3",
"@sapphire/stopwatch": "^1.4.1",
"@sapphire/time-utilities": "^1.7.5",
"@sapphire/ts-config": "^3.3.4",
"@sapphire/type": "^2.2.4",
"@sapphire/utilities": "^3.9.1",
"@typegoose/typegoose": "latest",
"@types/ms": "^0.7.31",
"@types/node": "^18.7.8",
"@types/ws": "^8.5.3",
"canvacord": "^5.4.8",
"colorette": "^2.0.19",
"discord-api-types": "^0.33.5",
"discord.js": "^14.7.1",
"dotenv-cra": "^3.0.2",
"got": "11.8.2",
"mongoose": "^6.5.2",
"node-superfetch": "0.2.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"prisma": "^4.8.1",
"reflect-metadata": "^0.1.13",
"tsc-watch": "^5.0.3",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/index.js",
"dev": "run-s build start",
"packages": "npm i",
"prod": "run-s packages dev",
"watch:start": "tsc-watch --onSuccess \"node ./dist/index.js\"",
"format": "prettier --write \"src/**/*.ts\""
},
"prettier": "@sapphire/prettier-config"
}
@Vladdy that's my package.json, ive nuked dist, node modules and package lock and reinstalled, it's still throwing the same error it compiles properly but doesn't start i have no idea how to fix this @Ararou your tsconfig lib fix didnt do a thing either btw yeah i am lost gonna try rebooting the code server
Solution
Hyper
Hyper2y ago
wait, i didn't update decorators
Hyper
Hyper2y ago
let's see if that's it i swear to god that was the issue I hate everything
24
242y ago
you should look up what a dev dependency is
Hyper
Hyper2y ago
Probably Ok all works Y'all can close this now
Ararou
Ararou2y ago
. Mf Did you even see what I sent in your dev server
Favna
Favna2y ago
Always update all your dependencies. Use something like vscode version lens
Hyper
Hyper2y ago
Gonna be honest no