Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brokenthorn opened this issue Oct 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@brokenthorn
Copy link

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/[email protected]/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

@brokenthorn brokenthorn added the bug Something isn't working label Oct 9, 2024
@pmanole-volvocars
Copy link

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/[email protected]/jsx-runtime *
    │ ├── https://deno.land/x/[email protected]/server.ts *
    │ ├─┬ https://deno.land/x/[email protected]/mod.ts (6.94KB)
    │ │ ├─┬ https://deno.land/x/[email protected]/deps.ts (787B)
    │ │ │ ├─┬ https://deno.land/x/[email protected]/mod.ts (28B)       <-------
    │ │ │ │ └─┬ https://deno.land/x/[email protected]/emoji.ts (4.34KB)
    │ │ │ │   ├── https://deno.land/x/[email protected]/types.ts (1.1KB)
    │ │ │ │   ├── https://deno.land/x/[email protected]/all.json (548.4KB)
    │ │ │ │   └── https://deno.land/x/[email protected]/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.

@airtonix
Copy link

airtonix commented Oct 13, 2024

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

@brokenthorn
Copy link
Author

Resolved by #688

@dominikj111
Copy link
Contributor

dominikj111 commented Oct 24, 2024

This doesn't seem to be fixed #689

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

@dominikj111
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants