Skrillx
Skrillx3d ago

deno_blog is broken

Hi! Not sure if deno_blog is still maintained since it's last commit was 3 months ago, but there's an error I'm encountering. I used this command to create my blog:
sh
$ deno run -r --allow-read --allow-write https://deno.land/x/blog/init.ts ./directory/for/blog/
sh
$ deno run -r --allow-read --allow-write https://deno.land/x/blog/init.ts ./directory/for/blog/
and then ran deno task serve to start the local development server. However, it throws an error:
sh
Task dev deno run --allow-net --allow-read --allow-env=NODE_DEBUG --watch --no-check index.js --dev
Watcher Process started.
error: Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.

import emojis from "./all.json" assert { type: "json" };

at https://deno.land/x/emoji@0.3.0/emoji.ts:2:1

Watcher Process failed. Restarting on file change...
sh
Task dev deno run --allow-net --allow-read --allow-env=NODE_DEBUG --watch --no-check index.js --dev
Watcher Process started.
error: Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.

import emojis from "./all.json" assert { type: "json" };

at https://deno.land/x/emoji@0.3.0/emoji.ts:2:1

Watcher Process failed. Restarting on file change...
I am using the latest version of Deno. Can anyone help me with this? Thanks!
7 Replies
iuioiua
iuioiua2d ago
Read the error message: deno_blog uses x/emoji, which uses assert instead of with in the import of ./all.json. In other words, x/emoji needs to be fixed.
Skrillx
SkrillxOP2d ago
Well how do I fix x/emoji? It's not like I can just edit the source code right Because I'm importing the entire blog code through
import blog from "https://deno.land/x/blog/blog.tsx";

blog();
import blog from "https://deno.land/x/blog/blog.tsx";

blog();
iuioiua
iuioiua2d ago
You’ll have to submit a pull request with x/emoji
Mrcool 🇵🇸
you can use "vendor": true in deno.json for now and patch the dependencies while you or someone else fix upstream
iuioiua
iuioiua2d ago
That too!
foobar
foobar2d ago
GitHub
Unable to Run in Dev · Issue #149 · denoland/deno_blog
It seems that the url being returned by callsites()[1].getFileName() in blog.tsx:109 doesn't include the 'file://', and is preventing fromFileUrl from parsing it correctly... deno task ...
Skrillx
SkrillxOP2d ago
Now I'm having an issue with "unable to fetch blog from remote url". I've tried the solution which involves changing deno versions, even tried building from source but it dosn't seem to work.

Did you find this page helpful?