discord-canvas icon indicating copy to clipboard operation
discord-canvas copied to clipboard

return Canvas._registerFont(fs.realpathSync(src), fontFace)

Open euandrelucas opened this issue 3 years ago • 35 comments

return Canvas._registerFont(fs.realpathSync(src), fontFace) ^

Error: Could not parse font file at Object.registerFont (C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\node_modules\canvas\index.js:48:17)
at Object. (C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\node_modules\discord-canvas\index.js:3:8)
at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\src\commands\Others\fnshop.js:3:16) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\bot.js:100:21 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: node bot.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Home\AppData\Roaming\npm-cache_logs\2021-01-07T15_18_05_141Z-debug.log

euandrelucas avatar Jan 07 '21 15:01 euandrelucas

code????? -.-

Shadyyey avatar Jan 08 '21 21:01 Shadyyey

no, it only gave this error when I downloaded the npm

euandrelucas avatar Jan 09 '21 13:01 euandrelucas

@yADGithub Try re-installing discord-canvas and canvas.

Shadyyey avatar Jan 23 '21 09:01 Shadyyey

i have it problem too

Vozmak avatar Apr 15 '21 23:04 Vozmak

Ok send me your code pls

imyanice avatar Apr 16 '21 09:04 imyanice

@Vozmak

imyanice avatar Apr 16 '21 09:04 imyanice

Ok send me your code pls

Hi. The error appears immediately upon require Const Canvas = require("discord-canvas") @xixi52

Vozmak avatar Apr 16 '21 11:04 Vozmak

Try npm uninstall discord-Canvas then npm i discord-canvas

imyanice avatar Apr 16 '21 13:04 imyanice

Try npm uninstall discord-Canvas then npm i discord-canvas

Anyway @Yan-Jobs

Vozmak avatar Apr 16 '21 15:04 Vozmak

Full error

return Canvas._registerFont(fs.realpathSync(src), fontFace) ^

Error: Could not parse font file at Object.registerFont (C:\Users\HP\Desktop\Текст и войс\node_modules\canvas\index.js:48:17) at Object. (C:\Users\HP\Desktop\Текст и войс\node_modules\discord-canvas\index.js:3:8) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Module.require (node:internal/modules/cjs/loader:997:19) at require (node:internal/modules/cjs/helpers:92:18) at Object. (C:\Users\HP\Desktop\Текст и войс\commands!profile.js:2:16) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Module.require (node:internal/modules/cjs/loader:997:19) at require (node:internal/modules/cjs/helpers:92:18) at C:\Users\HP\Desktop\Текст и войс\index.js:38:21

Vozmak avatar Apr 16 '21 15:04 Vozmak

2s

imyanice avatar Apr 16 '21 15:04 imyanice

Do u have this file ? : /assets/fonts/theboldfont.ttf

imyanice avatar Apr 16 '21 15:04 imyanice

sec

Vozmak avatar Apr 16 '21 15:04 Vozmak

in canvas or discord-canvas?

Vozmak avatar Apr 16 '21 15:04 Vozmak

Do u have this file ? : /assets/fonts/theboldfont.ttf

image Yes, have

Vozmak avatar Apr 16 '21 15:04 Vozmak

Is it empty ?

imyanice avatar Apr 16 '21 15:04 imyanice

no

Vozmak avatar Apr 16 '21 16:04 Vozmak

Ah

imyanice avatar Apr 16 '21 16:04 imyanice

font in my language in this file

Vozmak avatar Apr 16 '21 16:04 Vozmak

sry for my english

Vozmak avatar Apr 16 '21 16:04 Vozmak

Try copy all your files in a new directory but don’t copy this files: package-lock.json or yarn.lock node_modules folder

imyanice avatar Apr 16 '21 16:04 imyanice

sry for my english

I don’t care I am french 13 yrs old lmao

imyanice avatar Apr 16 '21 16:04 imyanice

Try copy all your files in a new directory but don’t copy this files: package-lock.json or yarn.lock node_modules folder

And reinstall dependency with npm init -y Or yarn (I think) and npm install or yarn install

imyanice avatar Apr 16 '21 16:04 imyanice

ok, i try it later, thx

Vozmak avatar Apr 16 '21 16:04 Vozmak

Anyway, i create absolutly new project and anyway error @Yan-Jobs

Vozmak avatar Apr 16 '21 17:04 Vozmak

Ah euh that’s not a good thing

imyanice avatar Apr 16 '21 17:04 imyanice

yes( very good npm, but dont work, ah

Vozmak avatar Apr 16 '21 17:04 Vozmak

xD

imyanice avatar Apr 16 '21 19:04 imyanice

Tomorrow I will dm the creator and ask him your problem

imyanice avatar Apr 16 '21 19:04 imyanice

Ok, thx

Vozmak avatar Apr 16 '21 23:04 Vozmak