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

Bug report #689

Open
iojanis opened this issue Oct 16, 2024 · 3 comments
Open

Bug report #689

iojanis opened this issue Oct 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@iojanis
Copy link

iojanis commented Oct 16, 2024

Followed the guide til the first execution after setting Github keys:

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...
´´´
@iojanis iojanis added the bug Something isn't working label Oct 16, 2024
@pchinjr
Copy link

pchinjr commented Oct 22, 2024

I don't know where the application calls the emoji package, however on Deno versions 2.0.0 and above this error blocks the watcher and the server never starts. On Deno versions below 2.0.0 the error is displayed, but the server will continue to start and the application will run locally.

pchinjr@WSL2:~/Code/saaskit$ deno upgrade --version 1.46.3
Current Deno version: v1.46.2
Downloading https://github.com/denoland/deno/releases/download/v1.46.3/deno-x86_64-unknown-linux-gnu.zip
Deno is upgrading to version 1.46.3

Upgraded successfully to Deno v1.46.3 (stable)

pchinjr@WSL2:~/Code/saaskit$ deno task start
Task start deno run --unstable-kv -A --watch=static/,routes/ --env dev.ts
Watcher Process started.
⚠️  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

The manifest has been generated for 22 routes and 3 islands.

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

GA4_MEASUREMENT_ID environment variable not set. Google Analytics reporting disabled.

And with Deno version 2.0

pchinjr@WSL2:~/Code/saaskit$ deno upgrade --version 2.0.0
Current Deno version: v1.46.3
Downloading https://github.com/denoland/deno/releases/download/v2.0.0/deno-x86_64-unknown-linux-gnu.zip
Deno is upgrading to version 2.0.0

Upgraded successfully to Deno v2.0.0 (stable)

Migration guide:

  https://docs.deno.com/runtime/manual/advanced/migrate_deprecations

Release notes:

  https://github.com/denoland/deno/releases/tag/v2.0.0

Blog post:

  https://deno.com/blog/v2.0

pchinjr@WSL2:~/Code/saaskit$ 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...

There's an incompatibility with the Deno 2.0 runtime that adopts the deprecation of assert imports. I guess the underlying emoji dep needs to be updated? But again, I don't know where this app is using the emoji module. Appreciate everyone working together. Cheers & Peace ✌️

@dominikj111
Copy link
Contributor

dominikj111 commented Oct 24, 2024

I did search in my deno cache folder grep -ri "https://deno.land/x/[email protected]/emoji.ts" ~/Library/Caches/deno and found file ~/Library/Caches/deno/remote/https/deno.land/5d49d55394eb4b08c3e1584cee7fbcfe86d3de744914f859079cab2d16ef75f8

import type { Emoji } from "./types.ts";
import emojis from "./all.json" assert { type: "json" };
import { reUnicode } from "./unicode.ts";

export { Emoji };

// Regex to parse emoji in a string - e.g. :coffee:
const reEmojiName = /:([a-zA-Z0-9_\-\+]+):/g;
...

where I replaced import emojis from "./all.json" assert { type: "json" }; by import emojis from "./all.json" with { type: "json" }; and it solved the server running.

I found closed issue about this one #687

@dominikj111
Copy link
Contributor

dominikj111 commented Oct 24, 2024

The issue is caused by this line https://github.com/denoland/saaskit/blob/main/plugins/blog/routes/blog/%5Bslug%5D.tsx#L3

But even the latest https://deno.land/x/gfm depends on https://deno.land/x/[email protected].
The issue is fixed in the https://deno.land/x/[email protected].

So the gfm needs an update, then the saaskit.
The fix will come in [email protected] https://github.com/denoland/deno-gfm/blob/main/deno.json#L6

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

No branches or pull requests

3 participants