Sabah Kaldwin
Sabah Kaldwin
DDeno
Created by Sabah Kaldwin on 1/9/2024 in #help
`deno cache` consistently failing with the same error
error: error sending request for url (https://deno.land/std@0.152.0/http/negotiation.ts): dispatch task is gone: runtime dropped the dispatch task It's not always the negotiation file, sometimes it's other dependencies also from deno.land/std that's running into the issue. Any clues on how to fix this?
3 replies
DDeno
Created by Sabah Kaldwin on 8/31/2023 in #help
How to import a npm package that relies on Wasm
I'm trying to import npm:@biscuit-auth/biscuit-wasm@0.4.0 and I wrote the following script:
import * as biscuitAuth from "npm:@biscuit-auth/biscuit-wasm@0.4.0";

const root = new biscuitAuth.KeyPair();
console.log(root);
import * as biscuitAuth from "npm:@biscuit-auth/biscuit-wasm@0.4.0";

const root = new biscuitAuth.KeyPair();
console.log(root);
However, I get the following error:
error: Unable to load ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit_bg.wasm imported from ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit.js

Caused by:
stream did not contain valid UTF-8
error: Unable to load ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit_bg.wasm imported from ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit.js

Caused by:
stream did not contain valid UTF-8
Looking at this stackoverflow post https://stackoverflow.com/questions/43122335/what-does-stream-did-not-contain-valid-utf-8-mean tells me that this error message comes from rust directly. Separately, I also tried out the following in node js:
import { KeyPair } from '@biscuit-auth/biscuit-wasm';

const root = new KeyPair();

console.log(root);
import { KeyPair } from '@biscuit-auth/biscuit-wasm';

const root = new KeyPair();

console.log(root);
and ran it with
node --experimental-wasm-modules run.js
node --experimental-wasm-modules run.js
and it ran fine with no issues:
(node:11768) ExperimentalWarning: Importing WebAssembly modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
biscuit-wasm loading
KeyPair { ptr: 1539832 }
(node:11768) ExperimentalWarning: Importing WebAssembly modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
biscuit-wasm loading
KeyPair { ptr: 1539832 }
Could this be part of the solution? Does deno have a --experimental-wasm-modules or something similar that I need to use, or is this an issue with how Deno imports wasm packages from npm?
1 replies
DDeno
Created by Sabah Kaldwin on 8/2/2023 in #help
deno info returns module not found
deno info https://raw.githubusercontent.com/Murcul/norm/v1.3.0/src/mod.ts
error: module could not be found
deno info https://raw.githubusercontent.com/Murcul/norm/v1.3.0/src/mod.ts
error: module could not be found
Trying to import that 3rd party public package causes the same issue with the same error. Replacing the url with the jsdelivr url however works fine
➜ ~ deno info https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/mod.ts
local: ~/.cache/deno/deps/https/cdn.jsdelivr.net/bbeaaad832c8774b3e299316fc9f25ed226f0baa182998c761329515b85a02cc
emit: ~/.cache/deno/gen/https/cdn.jsdelivr.net/bbeaaad832c8774b3e299316fc9f25ed226f0baa182998c761329515b85a02cc.js
type: TypeScript
dependencies: 233 unique
size: 3.03MB

https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/mod.ts (118B)
├─┬ https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/type-generator.ts (3.47KB)
│ └─┬ https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/deps.ts (768B)

// keeps going
➜ ~ deno info https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/mod.ts
local: ~/.cache/deno/deps/https/cdn.jsdelivr.net/bbeaaad832c8774b3e299316fc9f25ed226f0baa182998c761329515b85a02cc
emit: ~/.cache/deno/gen/https/cdn.jsdelivr.net/bbeaaad832c8774b3e299316fc9f25ed226f0baa182998c761329515b85a02cc.js
type: TypeScript
dependencies: 233 unique
size: 3.03MB

https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/mod.ts (118B)
├─┬ https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/type-generator.ts (3.47KB)
│ └─┬ https://cdn.jsdelivr.net/gh/Murcul/norm@1.3.0/src/deps.ts (768B)

// keeps going
The jsdelivr trick does unblock me, but I can't update the actual file and push a commit as the raw.githubusercontent url works fine for all my coworkers. Any ideas of why the raw.githubusercontent url does not work?
5 replies
DDeno
Created by Sabah Kaldwin on 5/29/2023 in #help
Running `deno cache` fails often with internal server errors when importing
Example message
error: Import 'https://deno.land/std@0.175.0/path/_constants.ts' failed: 500 Internal Server Error
May 29 10:30:08 AM #14 309.3 at https://deno.land/std@0.175.0/path/win32.ts:12:8
May 29 10:30:08 AM ------
May 29 10:30:08 AM Dockerfile:18
May 29 10:30:08 AM --------------------
May 29 10:30:08 AM 16 | WORKDIR /app
May 29 10:30:08 AM 17 |
May 29 10:30:08 AM 18 | >>> RUN deno cache ./main.ts
May 29 10:30:08 AM 19 |
May 29 10:30:08 AM 20 | CMD ["run", "--allow-net", "--allow-read", "--allow-env", "--allow-write", "main.ts"]
May 29 10:30:08 AM --------------------
May 29 10:30:08 AM error: failed to solve: process "/bin/sh -c deno cache ./main.ts" did not complete successfully: exit code: 1
May 29 10:30:08 AM error: exit status 1
error: Import 'https://deno.land/std@0.175.0/path/_constants.ts' failed: 500 Internal Server Error
May 29 10:30:08 AM #14 309.3 at https://deno.land/std@0.175.0/path/win32.ts:12:8
May 29 10:30:08 AM ------
May 29 10:30:08 AM Dockerfile:18
May 29 10:30:08 AM --------------------
May 29 10:30:08 AM 16 | WORKDIR /app
May 29 10:30:08 AM 17 |
May 29 10:30:08 AM 18 | >>> RUN deno cache ./main.ts
May 29 10:30:08 AM 19 |
May 29 10:30:08 AM 20 | CMD ["run", "--allow-net", "--allow-read", "--allow-env", "--allow-write", "main.ts"]
May 29 10:30:08 AM --------------------
May 29 10:30:08 AM error: failed to solve: process "/bin/sh -c deno cache ./main.ts" did not complete successfully: exit code: 1
May 29 10:30:08 AM error: exit status 1
The above happens often to our deployments, and it's usually a deno.land package. Rerunning the deployment usually succeeds, so we aren't really blocked, but this is frustrating with how frequent it is
2 replies
DDeno
Created by Sabah Kaldwin on 4/27/2023 in #help
Sentry DenoOsUptime is not a function issue
I'm using npm:@sentry/node@7.49.0 and the following script to test the integration
// sentry import and init here
async function testEvent() {
try {
throw new Error("Nope")
} catch (e) {
Sentry.captureException(e)
}
}

await testEvent()
// sentry import and init here
async function testEvent() {
try {
throw new Error("Nope")
} catch (e) {
Sentry.captureException(e)
}
}

await testEvent()
I did try adding Sentry.flush but that does not resolve the issue Instead of capturing the actual Nope error, all the issues that show up in Sentry are the DenoOs.Uptime is not a function Which is strange because I can see that this PR has already been merged https://github.com/denoland/deno_std/pull/3052
2 replies