didiercrunch
didiercrunch
DDeno
Created by didiercrunch on 9/19/2023 in #help
Basic react server side rendering does not work on Deno Deploy but does locally
The below application work correctly locally but fails on Deno Deploy. On Deno Deploy, all my responses have a status 500 and logs show an error ReferenceError: h is not defined at handler (file:///src/server.tsx:8:33).
import React from "https://esm.sh/react@18.2.0";

// @deno-types="https://denopkg.com/soremwar/deno_types/react-dom/v16.13.1/server.d.ts"
import ReactDOMServer from "https://esm.sh/react-dom@18.2.0/server";


const handler = (request: Request): Response => {
const body = ReactDOMServer.renderToStaticMarkup(
<div >hello world</div>
);
return new Response(body, {status: 200});
};

Deno.serve(handler);
import React from "https://esm.sh/react@18.2.0";

// @deno-types="https://denopkg.com/soremwar/deno_types/react-dom/v16.13.1/server.d.ts"
import ReactDOMServer from "https://esm.sh/react-dom@18.2.0/server";


const handler = (request: Request): Response => {
const body = ReactDOMServer.renderToStaticMarkup(
<div >hello world</div>
);
return new Response(body, {status: 200});
};

Deno.serve(handler);
I am sure that I am doing something stupid but I cannot figure out what. Can you help me spot it. cheers, didier
6 replies
DDeno
Created by didiercrunch on 6/13/2023 in #help
What a method prefixed with `#` means?
This is perhaps the stupidest question ever. But I often see method with names prefixed with a # character in typescript. What does it mean? Google does not seems to know either. example: https://deno.land/std@0.187.0/streams/text_line_stream.ts?source#L40
6 replies
DDeno
Created by didiercrunch on 6/9/2023 in #help
In memory Deno Kv
Hi there, I am exploring with Deno Kv and it looks great! But my test are failing because I reuse the same database over and over. Is there a way to initialize an in memory version of Deno.Kv ? Something like sqlite in memory (https://www.sqlite.org/inmemorydb.html)?
5 replies