I'm using an old version of Deno (version 1.38.4) and when trying to use the --v8-flags= parameter on the command line, with more than one flag, I get this error:
Error: illegal value for flag --max-old-space-size=4096 --expose-gc of type size_t
The solution is trivial: Just use comma:
example:
--v8-flags="--flag-1=xpto,--flag-2"
Programando sem cafeína
sábado, 27 de dezembro de 2025
Deno "Error: illegal value for flag --max-old-space-size=4096 --expose-gc of type size_t"
quarta-feira, 22 de outubro de 2025
How to exclude fields from pydantic submodels model_dump()
Everybody knows that using .model_dump() with exclude parameter we can exclude some attributes from the output. But if your model contains attributes that are other pytdantic models, and you want to hide some attributes of this submodel, the best solution, that are not so explicit in the pydantic documentation is define the attribute with annotated to be excluded, like this:
from pydantic import BaseModel, Field
from typing import Annotated
class MySubmodel(BaseModel):
not_hidden_attr: str
hidden_attr: Annotated[str, Field(exclude=True)]
class MyModel(BaseModel)
attr_of_submodel: MySubmodel
quinta-feira, 25 de setembro de 2025
Solution to "ModuleNotFoundError: No module named '_cffi_backend'" on python
Got this error executing grothbook lib on python3.11
To solve:
> pip install --upgrade cffi cryptography
segunda-feira, 7 de julho de 2025
Solution to "TypeError: error sending request for url (https://...) error trying to connect: invalid peer certificate: UnknownIssuer" in Deno
This error occurs for me when running Deno locally. My Deno version is older, 1.38.4:
Example error:
error: (in promise) TypeError: error sending request for url (https://esm.sh/dd-trace@5.36.0&pin=v135&no-dts/package.json): error trying to connect: invalid peer certificate: UnknownIssuer
const response = await fetch("https://esm.sh/dd-trace@5.36.0&pin=v135&no-dts/package.json");
Solution, export this environment variable:
DENO_TLS_CA_STORE=system
terça-feira, 13 de maio de 2025
Solution to "ImportError: cannot import name 'GrowthBookClient' from 'growthbook'"
If you're using version 1.2.1 of the GrowthBook Python library, you may have seen in the documentation on GitHub or PyPI that the GrowthBookClient should be imported like this:
from growthbook import GrowthBookClient
However, this results in the following error:
api/feature_flag_service.py", line 1, in <module>
from growthbook import GrowthBookClient, Options, UserContext
ImportError: cannot import name 'GrowthBookClient' from 'growthbook'
The fix is simple: instead of following the documentation, use the correct import path based on the actual library structure:
from growthbook.growthbook_client import GrowthBookClient
quinta-feira, 1 de maio de 2025
Solution to sqlx prepare error: failed to lookup address information: Name or service not known
I was getting the error "failed to lookup address information: Name or service not known" when running the command cargo sqlx prepare. The error seemed obvious — my DATABASE_URL environment variable was probably incorrect. However, after checking everything and confirming that it was correct (ad-hoc connections were working, and even the service startup connected successfully), I figured out the issue:
My service required additional environment variables to start. Without these env vars, it wouldn't start and would return an error. It turns out that when running cargo sqlx prepare without those variables, the error gets silently swallowed, and the database connection simply fails.
After supplying the same environment variables I use for cargo run to cargo sqlx prepare, the problem was resolved.
sexta-feira, 21 de março de 2025
Solution to failed to acquire username/password from local configuration on rust git libs
Let's say you need to work on a Rust project that depends on other libraries hosted in a private Git repository. This project uses the repository's HTTPS URL. For example:
your-lib = { git = "ssh://git@github.com/your-company/your-lib.git"}
Then you try to start the project and encounter the following error:
$ cargo run
Blocking waiting for file lock on package cache
Updating crates.io index
Updating git repository `https://github.com/your-company/your-lib.git`
error: failed to get `outbox-pattern-processor` as a dependency of package `anti-fraud-service v0.1.0 (/project/your-project)`
Caused by:
failed to load source for dependency `your-lib`
Caused by:
Unable to update https://github.com/your-company/your-lib.git?tag=v1.0.0#49efa247
Caused by:
failed to fetch into: /home/tiago.motta/.cargo/git/db/your-lib-31d59910066df49a
Caused by:
revision 49efa2476e2613cf809315b4b0abf16f079b5dcb not found
Caused by:
failed to authenticate when downloading repository
* attempted to find username/password via git's `credential.helper` support, but failed
if the git CLI succeeds then `net.git-fetch-with-cli` may help here
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
failed to acquire username/password from local configuration
The solution is simple. Just edit your global .gitconfig to replace HTTPS URLs with SSH by adding the following lines:
[url "ssh://git@github.com/"]
insteadOf = https://github.com/