We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"canvas": "^2.11.2"
// generate.ts import { createCanvas } from 'canvas'; import { fetchDataForAllYears } from './github'; import fs from 'fs'; async function generateContributionImage(username) { const data = await fetchDataForAllYears(username, 'flat'); const contributions = data.contributions; const canvasWidth = 53 * 12; const canvasHeight = 7 * 12; const canvas = createCanvas(canvasWidth, canvasHeight); const ctx = canvas.getContext('2d'); ctx.fillStyle = '#ffffff'; ctx.fillRect(0, 0, canvasWidth, canvasHeight); contributions.forEach(contribution => { const date = new Date(contribution.date); const x = ((date.getDay() + 1) % 7) * 12; const y = Math.floor(date.getTime() / (1000 * 60 * 60 * 24 * 7)) % 53 * 12; ctx.fillStyle = contribution.color; ctx.fillRect(x, y, 10, 10); }); const buffer = canvas.toBuffer('image/png'); fs.writeFileSync('./output.png', buffer); } generateContributionImage('0pandadev').catch(console.error);
bun run generate.ts
1 | 'use strict' 2 | 3 | const bindings = require('../build/Release/canvas.node') ^ TypeError: LoadLibrary failed: A dynamic link library (DLL) in at C:\Users\pandadev\Documents\Developer\Node\twitter-banner\node_modules\canvas\lib\bindings.js:3:7 at C:\Users\pandadev\Documents\Developer\Node\twitter-banner\node_modules\canvas\lib\canvas.js:9:7 at C:\Users\pandadev\Documents\Developer\Node\twitter-banner\node_modules\canvas\index.js:1:7 Bun v1.1.15 (Windows x64) ============================================================ Bun v1.1.15 (b23ba1fe) Windows x64 Args: "bun" "run" "src\generate.ts" Features: jsc dotenv transpiler_cache(3) Builtins: "bun:main" "node:assert" "node:buffer" "node:events" "node:fs" "node:http" "node:https" "node:path" "node:stream" "node:string_decoder" "node:url" "node:util" "node:util/types" "node:zlib" Elapsed: 366ms | User: 0ms | Sys: 0ms RSS: 0.14GB | Peak: 0.14GB | Commit: 0.16GB | Faults: 36396
Bun v1.1.15 (b23ba1f) on windows x86_64 [RunCommand]
b23ba1f
Segmentation fault at address 0x7FFC67DF0C70
0x5177c
0x514d7
0x5117d
0x17fab
0x1bed8
0x1c099
Global.zig:123
exitWide
Global.zig:106
exit
javascript.zig:1094
eventLoop
The text was updated successfully, but these errors were encountered:
@0PandaDEV, the latest version of Bun is v1.1.21, but this crash was reported on Bun v1.1.15.
Are you able to reproduce this crash on the latest version of Bun?
bun upgrade
Sorry, something went wrong.
upgrading did not fix the problem
canvas depends on V8 C++ API which is not implemented now, but will be added soon. try to use @napi-rs/canvas or smth else
canvas
@napi-rs/canvas
Duplicate of #5835
Please follow along in #5835
No branches or pull requests
How can we reproduce the crash?
"canvas": "^2.11.2"
Relevant log output
Stack Trace (bun.report)
Bun v1.1.15 (
b23ba1f
) on windows x86_64 [RunCommand]Segmentation fault at address 0x7FFC67DF0C70
0x5177c
in ntdll.dll0x514d7
in ntdll.dll0x5117d
in ntdll.dll0x17fab
in KERNEL32.DLL0x1bed8
in ucrtbase.dll0x1c099
in ucrtbase.dllGlobal.zig:123
:exitWide
Global.zig:106
:exit
javascript.zig:1094
:eventLoop
The text was updated successfully, but these errors were encountered: