Deno

D

Deno

Chat about Deno, a modern runtime for JavaScript and TypeScript.

Join

How can I change the port in Fresh?

I have tried the following in the Main.ts await start(manifest, { port: 3000 }), But I suspect this solution is long outdated. Thx....

Alternative to react-select

Hello is there some alternative to react-select with fresh? I don't find any working with preact/fresh did you have some hints?

How does Fresh run esbuild on Deploy without cache writes?

I'm trying to build some solidjs code during runtime, but I keep getting errors on Deploy because of writes to esbuild cache:
[uncaught application error]: PermissionDenied - Requires write access to '/src/.cache/esbuild/bin', but the file system on Deno Deploy is read-only.
[uncaught application error]: PermissionDenied - Requires write access to '/src/.cache/esbuild/bin', but the file system on Deno Deploy is read-only.
...

PyCharm notebooks syntax highlight

Hello. I have set up Deno to work with pycharm. I am able to run a jupyter server with Deno kernel selected. Cells execute correctly. One issue I have is that I don't have syntax highlight and autocompletion. Javascript and Typscript plugins are installed and working in .js and .ts files. Is there any other plugin or setting I am missing? I have installed and used Deno kernel in VS Code without any issues. But I definitely prefer pycharm....

wasmbuild & rust module path

I try to call some rust modules in a wasm project https://deno.com/blog/wasmbuild My tree project is ```...
No description

Deno does not recognize ".node" extension files

[name].node is C++ (kind of) addons compiled for using in Node.JS (as i get it) It just doesn't allow to run any code with it, since downloading npm:rosu-pp@0.9.4 with Deno, downloads everything EXCEPT index.node, but... default npm install rosu-pp does it, and runs very well, is there something I could do about it? Reproducing problem can be done with this TypeScript + Deno chapter in this paste...

Can use the --cert flag in the command line, but not in deno.json

I am trying to run my deno program with the following command: deno run -A --cert ~/tmp/ca.crt main.ts This works fine. However, if I put this command in my deno.json, it can no longer find the certificate: ```...

Deno - Sanitize Filters

Does Deno have anything similar to https://www.php.net/manual/en/filter.filters.sanitize.php for HTTP HTML POST forms? Example: ```typescript...

Having a problem while getting a file from form. Oak.

I'm having a problem while getting a file from a form. I can only read it's name, but not its body. How can I read file's body?...
No description

[RESOLVED] Async Route vs Sync Route: Signatures are error-prone

I am new to Deno Fresh and I ran into a strange bug (on my side), when changing a sync route to an async route, because I was getting the Request instead of the RouteContext/PageProps. As in the docs, I was using exported default functions (instead of typed Fat-Arrow-Functions) to define my routes. When changing a route to async, the compiler would not (and could not) warn me, that I am now accessing the wrong property, because at runtime the AsyncRoute will get an extra parameter "Request" as the first (!!!) parameter. A few questions pop up there for me:...

Installing a deno script

I have a deno script that I've written that takes a single arg. I want to install it so that I can call "tricky" in the same way I call "deno". I did deno install -A -n tricky .\main.js
and it said installed successfully but when I try to call it from the command line like "tricky <script-path>" it says its not recognized...

How to bundle my project

I have a mod.js file that I wrote with Deno and I want to bundle it and it depends on bunch of other file I ran esbuild mod.js --bundle --format=esm --outdir=dist and I try to use that in the browser but it doesn't download the dependecies...
No description

Odd server requests on my Delpoy project...

I was logging the requested paths to static files yesterday while troubleshooting an issue with a service worker... and there were some strange outliers that were definitely unrelated to the hosted page, can anyone tell me if this is normal noise? Here are some of the paths that got requested: ``` ["_404","/nf_tracking.php","2023-10-17"]...

error on installing

i do not know if im doing it right or something else
No description

Deno equivalent os.cpus().length

What’s the Deno Equivalent for os.cpus().length?

How can I get deno to access internal packages from a workspace in npm or bun?

I have the following workspace setup. I would like to have a deno/oak/kv project in the same folder that can also reference the packages in the workspace. is that possible with deno?
No description

How to resolve requires without `.js` extension in a very basic NPM resolver?

I have an NPM resolver that without caching that expects everything to be in a node_modules folder, mostly copied from deno cli https://gist.github.com/rust-play/fbd49c87332ee27b3d217bb1e0005462 I can successfully require lodash, but one of the npm libraries I'm trying to require imports a babel library like so...

How do I have a subrouter in Oak?

I want to use a subrouter in oak to handle part of the routing, how would I do that in Oak? here is an example in Express.js
app.use("/path/to/subrouter", subrouter);
app.use("/path/to/subrouter", subrouter);
...

rust ffi buffer overflow

hi, do i have to null-terminate array when using rust ffi? i'm getting buffer overflows. ```rs #[no_mangle] pub extern "C" fn play(path: *const u8) { let path = unsafe {...

How to actually sign out using deno_kv_auth

Not sure if bug or feature, but I have problems signing out from deno_kv_auth. I'm using Auth0 for testing, but actually the kv auth live demo at https://kv-oauth.deno.dev/ has the same issue, using GitHub provider. Basically, when first visiting the demo, and signing in, you get the GitHub login screen to authorize the sign in. All ok, sign in works. But then you sign out. Yes the session is cleared from the local server, but if you then click sign in again, you don't get the GitHub/Auth0 login screen, but instead get immediately authenticated with the previous credentials, and returned with a new successfully authenticated session....