onjara / optic

A powerful logging framework for Deno
MIT License
44 stars 4 forks source link

hrtime permission is not a thing in Deno 2.0 #14

Open erkiesken opened 2 weeks ago

erkiesken commented 2 weeks ago

Looks like there are checks for a removed permission that fail now in Deno 2.0:

error: Uncaught (in promise) TypeError: The provided value "hrtime" is not a valid permission name
  (await Deno.permissions.query({ name: "hrtime" })).state === "granted";
                          ^
    at Permissions.querySync (ext:runtime/10_permissions.js:211:13)
    at Permissions.query (ext:runtime/10_permissions.js:203:34)
    at https://deno.land/x/optic@1.3.11/utils/numberFormatter.ts:3:27

Release notes

I was using:

$ deno --version
deno 2.0.0 (stable, release, x86_64-unknown-linux-gnu)
v8 12.9.202.13-rusty
typescript 5.6.2
rajeshpv commented 1 week ago
console.log(Deno.version)

import { Logger } from "https://deno.land/x/optic/mod.ts";

const logger = new Logger();
logger.info("Hello world!"); 

Generates following output/error


{ deno: "2.0.0", v8: "12.9.202.13-rusty", typescript: "5.6.2" }
Stack trace:
TypeError: The provided value "hrtime" is not a valid permission name
    at Permissions.querySync (ext:runtime/10_permissions.js:211:13)
    at Permissions.query (ext:runtime/10_permissions.js:203:34)
    at https://deno.land/x/optic@1.3.11/utils/numberFormatter.ts:3:27
cknight commented 6 days ago

Thanks both. I'm currently working on migrating this library to Deno 2 and JSR.