spencer
spencer4mo ago

How do I troubleshoot this error?

I'm trying to run a fresh project I haven't touched in over a year. I ran the fresh updater but when I try to deno task start it, it gives me an error like this:
spencer@m1 ~/D/D/blog (main)> deno task start
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 5 routes and 0 islands.
error: Uncaught (in promise) TypeError: 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

const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))
^
at async dev (https://deno.land/x/fresh@1.7.3/src/dev/dev_command.ts:38:21)
at async file:///Users/spencer/Developer/Deno/blog/dev.ts:7:1
Watcher Process failed. Restarting on file change...
^C⏎
spencer@m1 ~/D/D/blog (main)> deno task start
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 5 routes and 0 islands.
error: Uncaught (in promise) TypeError: 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

const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))
^
at async dev (https://deno.land/x/fresh@1.7.3/src/dev/dev_command.ts:38:21)
at async file:///Users/spencer/Developer/Deno/blog/dev.ts:7:1
Watcher Process failed. Restarting on file change...
^C⏎
I'm not really sure what needs that emoji package (it's not explicitily listed in my deno.json) so I'm not sure how to troubleshoot it? It looks like their is a newer version of the emoji.ts package but I don't know how to update to that since it's not in my deno.json. deno outdated doesn't show anything either
3 Replies
spencer
spencerOP4mo ago
I guess it worked by adding "https://deno.land/x/emoji@0.3.0/": "https://deno.land/x/emoji@0.3.1/", to my imports but I'm not sure if that's the best solution
macexpert#2023
macexpert#20232mo ago
Yes, same here. I did adding "https://deno.land/x/emoji@0.3.0/emoji.ts": "https://deno.land/x/emoji@0.3.1/emoji.ts", to deno.json and then it solve. but best if deno fresh developer can solve it while release next update.
marvinh.
marvinh.2mo ago
This is an error in the emoji library not in Fresh. Older proposals of the import attribute syntax used the assert keyword instead of with. This error cannot be fixed in Fresh.

Did you find this page helpful?