bombillazo
bombillazo
DDeno
Created by bombillazo on 12/13/2024 in #help
Issues migrating dependencies from v1.x to v2.x
Hey, I'm facing some issues when upgrading from v1.146 to v2. We have a backend monorepo that uses import_map.json files to manage dependencies per sub module in our monorepo. We don't have a package.json for Deno (only for our Next.js frontend which is still on node). We do have a deno.jsonc at the root level of our project. After upgrading to Deno v2, we get these errors when we run or try to install:
# install
error: Error in @stripe/react-stripe-js@3.1.0 parsing version requirement for dependency "react-dom": ">=16.8.0 && <=^19.0.0"
deno install
Caused by:
0: Invalid version requirement
1: Unexpected character.
>=16.8.0 && <=^19.0.0
~
# install
error: Error in @stripe/react-stripe-js@3.1.0 parsing version requirement for dependency "react-dom": ">=16.8.0 && <=^19.0.0"
deno install
Caused by:
0: Invalid version requirement
1: Unexpected character.
>=16.8.0 && <=^19.0.0
~
# run
Running service
Watcher Process started.
error: Could not find a matching package for 'npm:pg@8.12.0' in the node_modules directory. Ensure you have all your JSR and npm dependencies listed in your deno.json or package.json, then run `deno install`. Alternatively, turn on auto-install by specifying `"nodeModulesDir": "auto"` in your deno.json file.

Watcher Process started.
error: [ERR_MODULE_NOT_FOUND] Cannot find module 'file:///Users/app/node_modules/type-fest/index.js' imported from 'file:///Users/app/@types/date.types.ts'
at file:///Users/app/@types/date.types.ts:8:24
# run
Running service
Watcher Process started.
error: Could not find a matching package for 'npm:pg@8.12.0' in the node_modules directory. Ensure you have all your JSR and npm dependencies listed in your deno.json or package.json, then run `deno install`. Alternatively, turn on auto-install by specifying `"nodeModulesDir": "auto"` in your deno.json file.

Watcher Process started.
error: [ERR_MODULE_NOT_FOUND] Cannot find module 'file:///Users/app/node_modules/type-fest/index.js' imported from 'file:///Users/app/@types/date.types.ts'
at file:///Users/app/@types/date.types.ts:8:24
this is part of our import_map.json file:
{
"imports": {
"kysely": "https://esm.sh/kysely@0.27.5",
"pg": "npm:pg@8.12.0",
"query-string": "https://esm.sh/query-string@9.1.1?dts",
"remeda": "https://esm.sh/remeda@2.17.4?dts",
"stripe": "https://esm.sh/stripe@17.4.0?dts",
"type-fest": "npm:type-fest@4.30.1",
"zod": "https://deno.land/x/zod@v3.24.1/mod.ts"
}
}
{
"imports": {
"kysely": "https://esm.sh/kysely@0.27.5",
"pg": "npm:pg@8.12.0",
"query-string": "https://esm.sh/query-string@9.1.1?dts",
"remeda": "https://esm.sh/remeda@2.17.4?dts",
"stripe": "https://esm.sh/stripe@17.4.0?dts",
"type-fest": "npm:type-fest@4.30.1",
"zod": "https://deno.land/x/zod@v3.24.1/mod.ts"
}
}
What is the proper way to step Deno dependencies for v2 in a monorepo, and should we keep using import maps?
2 replies
DDeno
Created by bombillazo on 12/13/2024 in #help
Deno vs Node `Intl.DateTimeFormat().resolvedOptions()` discrepancies
No description
10 replies
DDeno
Created by bombillazo on 8/13/2024 in #help
Reset position of terminal cursor when calling io.writeAllSync()
Currently using io.writeAllSync, the next data is written where the last data left off, even with a new line the cursor is kept horizontally in the position that was left. I tried the ansi library cursorBack function but it did not work, how can I control or reset the cursor?
2 replies
DDeno
Created by bombillazo on 8/13/2024 in #help
How to log Deno.Command output in real time (not after command completes)
Hello, is there a guide on how to log stdout with a Deno.Command is running, not just after it completes?
6 replies
DDeno
Created by bombillazo on 7/3/2024 in #help
Is there any way to force a Deno dependency to use a specific version of std?
We're having an issue were a dependency we are importing from npm with the npm: identifier is trying to use a node lib that only exisits up to std v0.177.0, specifically the tty lib. Our main std version is in 0.244.0 specified in our import_map.json file. Is there any way to specify this 3rd party dep to use the std version it requires to work?
2 replies
DDeno
Created by bombillazo on 4/11/2024 in #help
How to upgrade `import_map.json` package versions?
Hello, in node I used ncu to check for new package versions and automatically update the versions. Is there any utility for deno to scna my packages and check if there are new versions?
4 replies
DDeno
Created by bombillazo on 1/31/2024 in #help
Run `nvm` using Deno.Command
Hello, I am trying to run nvm from a Deno script using Deno.Command.
new Deno.Command('nvm', {
args: ['use'],
stderr: 'inherit',
stdin: 'inherit',
stdout: 'piped',
}).outputSync;
new Deno.Command('nvm', {
args: ['use'],
stderr: 'inherit',
stdin: 'inherit',
stdout: 'piped',
}).outputSync;
but I am getting the following error:
Failed to spawn 'nvm': No such file or directory (os error 2)
Failed to spawn 'nvm': No such file or directory (os error 2)
nvm was install with brew and I tried passing env: {PATH: Deno.env.get('PATH') but nothing works...
2 replies
DDeno
Created by bombillazo on 12/25/2023 in #help
Deno.Command output as it runs
Hello, I am trying to run a command and have its output be logged as it runs , but for some reason the command runs but no output is displayed. I tried using both ouput with await and outputSync, setting stdout to piped and inherit but nothing.
6 replies
DDeno
Created by bombillazo on 10/4/2023 in #help
Deno compile target error
No description
2 replies
DDeno
Created by bombillazo on 10/3/2023 in #help
Deno Cache location
Hello, I am trying to cache my dependencies during the compile action using Github Actions, where does deno locate the cache when d dependencies on Ubuntu?
3 replies
DDeno
Created by bombillazo on 9/12/2023 in #help
Syntax Error: Unexpected token 'export'
Hello, We are using Supabase Deno Edge Functions and are getting this error while trying to import a file into an edge function code: Uncaught SyntaxError: Unexpected token 'export' at file:///home/deno/modules/c675a10248170410cad4e4a996152aad5ad7f2a817728186567122b6394d9419:185:1 InvalidWorkerCreation: worker boot error I checked the edge runtime file and the file code is as my source code, yet the edge function fails to run throwing this error. I'm not sure why this is happening though.
4 replies
DDeno
Created by bombillazo on 9/11/2023 in #help
Deno Deploy Questions
Hey there. We are using Supabase to run edge functions, which in turn built their feature on top of Deno Deploy. I'd like to know more about how Deno Deploy works. Our main inquiry are on topics such as how fast can these functions scale, and how do they manage request load balancing and load, where are these edges, what caching (if any) mechanisms are used, do they become "cold" after some time, how "ephemeral" are these functions in case some troubleshooting or reboot is required, etc. This comes since we've noticed some latency issues sometimes when we use our app and want to understand the root cause but searching on the guides we have no notion of how exactly are these edge functions being deployed and run and their surrounding environment. Any more in-depth info would help us greatly .
17 replies
DDeno
Created by bombillazo on 9/7/2023 in #help
Does Deno support `export type` statements?
Hello, we are using Deno + TS and I am getting the following error if I try to export a type from another file:
Uncaught SyntaxError: Unexpected token 'export'
Uncaught SyntaxError: Unexpected token 'export'
Is this something possible in Deno?
2 replies
DDeno
Created by bombillazo on 9/7/2023 in #help
How can one patch a Deno dependency?
Hello, We're used to working with node and using patch-package to override and fix packages fairly easily. However, we're now using Deno due to using Supabase edge functions and have not figure a way to get the same dev experience. Is there any guide or way one can patch a dependency in Deno?
9 replies