denoland/saaskit

First time `deno task start` fails with Deno 2.0: error: Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.

Closed this issue · 5 comments

I followed the Saaskit README and cloned the repository, set up .env as described, and when I ran deno task start I got:

➜ deno task start
Task start deno run --unstable-kv -A --watch=static/,routes/ --env dev.ts
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...

Not long ago, in 2.0 RC, the above was a warning (I checked the code) in Deno, but now in 2.0 it's an error (for good reason, the syntax is deprecated and unsupported).

I tried deno task update and the results after this are the same.

I also tried a clean Fresh project with deno run -A -r https://fresh.deno.dev and deno task start ran without issue, so the error must not be from Fresh.

Also the x/emoji module is a peer dependency and I don't know how to check which module is using it. Version 0.3.1 fixes the use of the assert keyword for import assertions, replacing it with with but I don't know how I could fix this or which package to upgrade or open a PR with...

To Reproduce

  1. Go to the Saaskit README.md
  2. Follow the steps to create a new Saaskit project up until and including starting the project
  3. See error

Expected behavior

The app should have started locally for the first time when following the README instructions correctly.

Screenshots

image

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 129.0.6668.90 (Official Build) (arm64)

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser N/A
  • Version N/A

Additional context

N/A

I found out how to view dependencies with deno info. Sorry, new to Deno. Trying it out for the first time.

file:///Users/REDACTED/Code/retinfo/dev.ts (253B)
└─┬ file:///Users/REDACTED/Code/retinfo/fresh.config.ts (769B)
  └─┬ file:///Users/REDACTED/Code/retinfo/plugins/blog/mod.ts (667B)
    ├─┬ file:///Users/REDACTED/Code/retinfo/plugins/blog/routes/blog/[slug].tsx (1.35KB)
    │ ├── https://esm.sh/preact@10.22.0/jsx-runtime *
    │ ├── https://deno.land/x/fresh@1.7.2/server.ts *
    │ ├─┬ https://deno.land/x/gfm@0.2.5/mod.ts (6.94KB)
    │ │ ├─┬ https://deno.land/x/gfm@0.2.5/deps.ts (787B)
    │ │ │ ├─┬ https://deno.land/x/emoji@0.3.0/mod.ts (28B)       <-------
    │ │ │ │ └─┬ https://deno.land/x/emoji@0.3.0/emoji.ts (4.34KB)
    │ │ │ │   ├── https://deno.land/x/emoji@0.3.0/types.ts (1.1KB)
    │ │ │ │   ├── https://deno.land/x/emoji@0.3.0/all.json (548.4KB)
    │ │ │ │   └── https://deno.land/x/emoji@0.3.0/unicode.ts (3.82KB)

I stripped out the blog module and the project now starts successfully!

➜ deno task start 
Task start deno run --unstable-kv -A --watch=static/,routes/ --env dev.ts
Watcher Process started.
The manifest has been generated for 22 routes and 3 islands.

 🍋 Fresh ready 
    Local: http://localhost:8000/

Might the blog module need updating?

gfm 0.6.0 is the latest version.

gfm is a GitHub flavored Markdown renderer, supporting GitHub style emojis, which is why it depends on the emoji lib that is causing the error on this issue.

gfm 0.6.0 is the latest version.

For some reason the gfm package isn't being published to deno land any more.

this is fixed when #684 lands

Resolved by #688

This doesn't seem to be fixed #689

I'm confused: denoland/deno-gfm#128

So it isn't solved :) .... the #688 was closed in favour #684 and that is still open.

I've merge request to fix only that 6c6399b but it doesn't pass tests as the CI is broken what I solved by #694