image-resizing-api
image-resizing-api copied to clipboard
issue: ReferenceError: __dirname is not defined
I am getting this error:
gcp-us-east4 isolate start time: 111.91 ms
gcp-us-east4 Listening on http://localhost:80/
gcp-asia-south1 ReferenceError: __dirname is not defined
at https://deno.land/x/[email protected]/src/wasm/magick_native.js:9:1767
at https://deno.land/x/[email protected]/src/image-magick.ts:26:7
at new Promise (<anonymous>)
at new ImageMagick (https://deno.land/x/[email protected]/src/image-magick.ts:20:19)
at Function._create (https://deno.land/x/[email protected]/src/image-magick.ts:38:39)
at https://deno.land/x/[email protected]/src/image-magick.ts:239:30
Change the wasm import to (update the version):
import {
ImageMagick,
initializeImageMagick,
MagickGeometry,
} from "https://deno.land/x/[email protected]/mod.ts";
But then you'll have a new error about not being able to read magick.wasm (invalid URL).
Good luck!