Open supfiger opened 1 year ago
Looks like an error in your bundle output (denoflare uses deno bundle
under the hood).
Try running serve
without local isolation:
$ denoflare serve <path> --local-isolation none
You'll lose hot reload, but it will try to import your bundle directly in the main process, perhaps allowing you to see the error.
Could also try running deno bundle
on your script and look at the output for the duplicate concat
it's complaining about
About running with --local-isolation none
:
$ denoflare serve src/prod-cloudflare.ts --local-isolation none
error: Uncaught (in promise) TypeError: Relative import path "src/prod-cloudflare.ts" not prefixed with / or ./ or ../
const module = await import(scriptPath);
$ denoflare serve ./src/prod-cloudflare.ts --local-isolation none
error: Uncaught (in promise) TypeError: Module not found "https://raw.githubusercontent.com/skymethod/denoflare/v0.5.12/common/src/prod-cloudflare.ts".
const module = await import(scriptPath);
$ denoflare serve /Users/supfiger/coding/apps/mine/deno-grammy/src/prod-cloudflare.ts --local-isolation none
error: Uncaught (in promise) TypeError: Module not found "https://raw.githubusercontent.com/Users/supfiger/coding/apps/mine/deno-grammy/src/prod-cloudflare.ts".
const module = await import(scriptPath);
Looks like if I provide absolute path to file, it tries to get it not from skymethod
repo, but from the provided path, but it's an invalid path (and even more – my repo is private).
I also ran deno bundle src/prod-cloudflare.ts
and haven’t got any error.
Do you have bare imports in your script? Denoflare supports ./
and https://...
old school Deno imports, nothing that requires import map config or npm deps etc.
In my Deno grammY application, when I call apiThrottler function from @grammyjs/transformer-throttler package, and run
$ denoflare serve src/prod-cloudflare.ts
, I've got the following error:Context:
But, on Node.js, and using it (@grammyjs/transformer-throttler) via NPM – it works OK (it means I don't get this error).