zing
zing
DDeno
Created by zing on 1/23/2025 in #help
Different behaviour between Node and Deno with npm package
update: I dove into the lib code which was quite heavily reliant on the isomorphic-ws npm package(more specifically the ws package). I created a replica replacing all the websocket code with the equivalents from the following deno package: https://deno.land/x/websocket@v0.1.4. This seems to work 🙂
2 replies
DDeno
Created by zing on 1/14/2025 in #help
Relative import path "oak/router" not prefixed with / or ./ or ../ and not in import map
thanks for your reply. I had added that import map as part of a few initial attempts to get around this issue, and interestingly it does work using that, combined with my workaround mentioned above. Subsequently though I have removed it and tested removing some of my explicit imports from deno.json, which to my surprise has started working. So essentially my project is back in the state that it was when I first ran into this issue(at least I think it is) however it is now working. maybe something is fixed now or of course I could have been mistaken all along 🙂 thanks
5 replies
DDeno
Created by zing on 1/14/2025 in #help
Relative import path "oak/router" not prefixed with / or ./ or ../ and not in import map
I have figured out that explicitly adding the sub paths of the imports to my deno.json file seems to solve the issue, for example: if I want to use oak/router in main.ts, I have to add "oak/router": "jsr:@oak/oak@17.0.0/router", to deno.json(ontop of the already existing oak import). This is weird, because locally I can just have the top level oak import and deno automatically resolves jsr:@oak/oak@17.0.0/router when I specify oak/router. I wonder why this is different when deploying, perhaps something to do with deployctl?
5 replies
DDeno
Created by Arkatme on 7/30/2023 in #help
Site runs fine but vscode is filled with errors.
haha sweet
8 replies
DDeno
Created by Arkatme on 7/30/2023 in #help
Site runs fine but vscode is filled with errors.
I've had similar things. Adding "deno.importMap": "deno.json" to .vscode/settings.json, with a window reload, solved a lot of these kinds of issues for me. Sometimes the editor does seem to get stuck though where everything is red, usually a window reload works as well.
8 replies
DDeno
Created by zing on 7/11/2023 in #help
Fresh pattern help
thanks 👍
7 replies
DDeno
Created by zing on 7/11/2023 in #help
Fresh pattern help
100%. Would need to persist it somehow in the island the first time the page loads. The cookie route seems cleaner in this case. Although I am trying to get my head around the possibilities because this is quite a common use case if I'm not mistaken. Submit form -> load new page with data from the the form.
7 replies
DDeno
Created by zing on 7/11/2023 in #help
Fresh pattern help
Thanks. I'll think about that. I suppose another way would be to set the form to POST directly to /chat, and then have a POST handler there that does a ctx.render(). Not sure about the downsides to either of these yet.
7 replies