question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I am working on this cross-canvas demo to demonstrate using roughly the same code (with a different frame around it) in browser vs deno. I use a base64-image to keep the demo self-contained, and when I run it in deno, I get this:

../deno-pr-buffers/target/debug/deno run --unstable --allow-all ./examples/canvas_cross.js
error: Uncaught (in promise) NotFound: No such file or directory (os error 2)
    data = await Deno.readFile(url);
           ^
    at deno:core/01_core.js:106:46
    at unwrapOpResult (deno:core/01_core.js:126:13)
    at async open (deno:runtime/js/40_files.js:51:17)
    at async Object.readFile (deno:runtime/js/40_read_file.js:20:18)
    at async loadImage (https://deno.land/x/canvas@v1.3.0/src/canvas.ts:28:12)
    at async Object.setup (file:///home/konsumer/Documents/otherdev/deno-minifb/examples/canvas_cross.js:51:19)
    at async mainDeno (file:///home/konsumer/Documents/otherdev/deno-minifb/examples/canvas_cross.js:67:3)

Do I need to do something special to base64 images?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DjDeveloperrcommented, Sep 15, 2021

It’s not released in any new version yet, you’ll have to use main branch/the commit

0reactions
konsumercommented, Sep 15, 2021

Sorry, I wasn’t thinking. Changing the import works great:

import { loadImage, createCanvas } from 'https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/master/mod.ts'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Base64 Image Encoder
Optimize your images and convert them to base64 online. Drag & Drop your files, copy to clipboard with a click and use the...
Read more >
Base64 to Image Decoder / Converter - Code Beautify
Best Online tool to converts base64 string into image. It's easy to use base64 image decoder which helps to decode picture and Download....
Read more >
Base64 Image Encoder - Convert any image file ... - elmah.io
With Base64 Image Encoder, you can convert any image file or URL to either Base64, HTML, CSS, JSON, or XML online. Everything happens...
Read more >
How to convert image to Base64 online - Base64.Guru
1. Choose the source of image from the “Datatype” field. 2. Paste the URL or select an image from your computer. 3. If...
Read more >
Base64 Image Maker - W3docs
Use this online free Base64 Image Maker tool that quickly uploads an image of jpeg, gif and png format type and convert it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found