Mark G
Mark G
DDeno
Created by Mark G on 12/2/2024 in #help
Dealing with errors in Response streams?
I've encountered problems whilst attempting to stream Responses, and discovered that if an error is thrown within the stream it just seems to be completely swallowed. Here's a simple example:
#!/usr/bin/env -S deno run --allow-net --watch

await Deno.serve(() => {
return new Response(ReadableStream.from(content()));
}).finished;

// deno-lint-ignore require-yield
function* content() {
throw new Error("EPIC FAIL");
}
#!/usr/bin/env -S deno run --allow-net --watch

await Deno.serve(() => {
return new Response(ReadableStream.from(content()));
}).finished;

// deno-lint-ignore require-yield
function* content() {
throw new Error("EPIC FAIL");
}
Hit the server and the request fails, but no errors are logged. Is there a preferred way to handle the errors in a stream? Or this is a bug in Deno? IMHO it feels like one, I wouldn't expects errors to just silently vanish like this.
4 replies
DDeno
Created by Mark G on 11/7/2024 in #help
Can you override compileOptions.jsx via a flag?
I'd like to be able to change the jsx option to react-jsxdev in my start dev task, without having to alter the deno.json file. Is there a deno cmd line or env var to set this?
2 replies
DDeno
Created by Mark G on 7/2/2024 in #help
invalid peer certificate: UnknownIssuer
I'm running two https localhost services on different ports, and used mkcert to install a local CA, and create certs for each service. One service attempts to fetch from the other, but it's failing with error trying to connect: invalid peer certificate: UnknownIssuer I've set DENO_TLS_CA_STORE=system. I can access both services in Chrome and Firefox. This used to work sometime ago (both MacOS and Deno have both upgraded since). I'm now on MacOS 14.5 and Deno 1.44.4. I'm a bit stumped as to why this no longer works, any ideas?
3 replies
DDeno
Created by Mark G on 3/18/2024 in #help
Is there a way to obtain Deno.cron schedule info?
Deploy lists the registered cron jobs with name, schedule, last run and next run. Is there a programatic way to obtain this information, in both cli and deploy Deno?
4 replies
DDeno
Created by Mark G on 2/9/2024 in #help
Anyone aware of a streaming multipart parser for Deno?
I'd like to handle the parts of a multipart/form-data stream in a server as they arrive rather than waiting for a complete upload and using FormData. Ideally this would be a TransformStream that parsed the body into a stream of parts, which in turn contained the appropriate metadata and a content stream for each part. I've been searching for any kind of implementation like this and not found anything from the wider JS ecosystem, let alone for Deno. Does anyone else know of something like this, or maybe a nice multipart parser that could be adapted? I wanted to avoid duplicating effort, but if it's not already been done, I may have a bash at it myself.
2 replies
DDeno
Created by Mark G on 11/2/2023 in #help
In-browser testing
I need to run some tests in a browser (Chrome, Firefox, Safari). Either by running a full test suite in the browser (ideally I like to run the suite in Deno too) or by connecting to and automating the browser, doesn't really matter. I'd really like to do this from Deno, and not have to go back to some node test framework. Can anyone suggest anything related that they've had success with in Deno?
4 replies
DDeno
Created by Mark G on 5/15/2023 in #help
Does kv delete recursively?
For example, if I have entries with keys: ['users', 1], ['users', 2], will kv.delete(['users']) delete both of those entries?
7 replies
DDeno
Created by Mark G on 2/13/2023 in #help
Suggestions for minimal JSX rendering?
Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner from Deno? I'm currently using preact and preact-render-to-string, but i feel that may just be a bit overkill. I don't need client-side, hooks, or any other preact/react features.
7 replies
DDeno
Created by Mark G on 10/13/2022 in #help
Is there a way to determine what modules have been dynamically imported at runtime?
The builtin tools to compile/bundle/vendor don't account for dynamic imports (understandably), but is there a way at runtime that we could see what has been imported dynamically. This information could then be used to aid other tools, for example to generate a module that statically imports all of those dynamic modules.
1 replies