Skrillx
Skrillx2mo 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!
10 Replies
iuioiua
iuioiua2mo 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
SkrillxOP2mo 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
iuioiua2mo ago
You’ll have to submit a pull request with x/emoji
Mrcool 🇵🇸
Mrcool 🇵🇸2mo ago
you can use "vendor": true in deno.json for now and patch the dependencies while you or someone else fix upstream
iuioiua
iuioiua2mo ago
That too!
foobar
foobar2mo 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
SkrillxOP2mo 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.
©TriMoon™
©TriMoon™2mo ago
Submit a bug report at x/emoji maintainers repo https://deno.land/x/emoji, and hope they fix it soon, else you need to dive in and fix the assert=>with usage... The JavaScript language has changed since they coded it, so they need to update their code... You could also clone their repo, fix the wrong keyword usage in your fork, and import from your repo for your usage...
©TriMoon™
©TriMoon™2mo ago
GitHub
Comparing 0.3.0...0.3.1 · denosaurs/emoji
🦄 Emojis for dinosaurs. Contribute to denosaurs/emoji development by creating an account on GitHub.
Skrillx
SkrillxOP2mo ago
Noted, I'll do that

Did you find this page helpful?