I have use @/ as Root

I have used @/ as root but now it doesnt finds the modules I'm not sure how to fix that anyone that can help me out?
No description
Solution:
setting it in only tsconfig isnt enough. Ts doesnt recompute paths when compiling. Either use NodeJS built in submodule imports and switch to # instead of @ in the process, or use something like the module-alias package.
Jump to solution
7 Replies
Solution
Favna
Favna2w ago
setting it in only tsconfig isnt enough. Ts doesnt recompute paths when compiling. Either use NodeJS built in submodule imports and switch to # instead of @ in the process, or use something like the module-alias package.
✞
OP2w ago
there is any youtube tutorial that already have done it on spphirejs or something?
Favna
Favna2w ago
No idea. Written guides and documentation are far more valuable for programming anyway as they are less likely to be heavily opinionated and or outdated. Many bots from the following list use it though:
Spinel
Spinel2w ago
Discord Bots using @sapphire/framework v5.x - Gemboard ᴱ ᴰ - Skyra ᴱ ᴬ ᴰ - Dragonite ᴱ ᴰ - Archangel ᴱ ᴰ - Official Bot Examples ᴱ ᴰ ᴶˢ - KBot ᴱ ᴬ ᴰ - Perpetual Mechanical Array ᴰ - Birthdayy ᴰ - Sapphire Application Commands Examples ᴱ Legend for the identifiers : Uses ESM (if not specified then uses CJS) : Advanced bot (if not specified it is a simple bot, or not graded) : Uses Docker in production ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
dan
dan2w ago
tsc-alias is also pretty good, and requires no configuration. It is pretty good at figuring out things on its own
Favna
Favna2w ago
I can see the advantages yes but I would recommend using the NodeJS solution still as there are also runtime advantages of having shorter and aliased paths (minor speed improvements in path resolutions) and you can only achieve that with the NodeJS built in method.

Did you find this page helpful?