#AstroDB db.d.ts doesn't always update

29 messages ยท Page 1 of 1 (latest)

charred eagle
#

When I add a field to a table it won't be added to db.d.ts. Sometimes when I update the names of fields it works but not always either.

What triggers the generation?

glass thunder
#

You can run astro sync or restart your dev server which will automatically run it and regenerate types if anything changed

charred eagle
#

That didn't work

#

Sometimes it works on some tables and other times it won't add the type, and I've tried syncing and rerunning dev server but the file doesn't update to reflect the table config

charred eagle
#

The types not being in sync is almost a constant issue now as soon as we make changes in the tables

mossy timber
#

I'm seeing this as well

glass thunder
#

<@&1129102257422610512> any thoughts here?

magic bane
#

just to verify... you are not working with anything other than the local dev db(gets auto reset on change) created by astro in this case? (using an actual DB will require you to run astro db push to verify your remote database and could require you to also reset your remote database to an empty state depending on the changes you are trying to apply)

Also do you have a seed.ts file your working with?

charred eagle
magic bane
charred eagle
#

I might add that the types is the only thing breaking, the data is still correct with the config file, so it's on the the analyzies that breaks (the type file not updating)

magic bane
#

do you have a minimal repro i could take i look at? I have a pretty good understanding of astrodb ๐Ÿ˜…

charred eagle
#

Sadly I don't really have a minimal reproduce codebase. It's a private project that we previously used Astro studio and now use turso with with astro db

magic bane
#

could you run astro info and provide your package.json?

charred eagle
#

if it helps this is our turso env for the remote url (I changed the url)

this one we didn't get working before so we use the one below, does that have an impact?
//ASTRO_DB_REMOTE_URL="file:/.astro/content.db?syncInterval=60&syncUrl=libsql://oururl.io"

ASTRO_DB_REMOTE_URL="libsql://oururl.io"

#

I want to remember that we didn't have any issues with this when using the astro studio connection vs turso connection

magic bane
#

did you recently update your local node version? I've personally never used node 23(and have heard others having issues with it as well), could you try downgrading that to a 22.x or 20.x LTS version and see if that fixes it?

I will note, i am one of the developers of StudioCMS, our team also use Turso with astroDB for development DBs, and haven't been able to use embedded replias with the local file:/ type url with syncs due to weird libsql issue. just using our basic libsql:// url provided from Turso has been working fine. so this is weird for sure!

mossy timber
#

I'm having the issues as well, and here's my astro info. My node version is 22.x

Astro                    v4.9.0
Node                     v22.9.0
System                   macOS (arm64)
Package Manager          unknown
Output                   server
Adapter                  @astrojs/vercel/serverless
Integrations             @astrojs/react
                         @astrojs/tailwind
                         astro:db
                         @astrojs/db/file-url
                         astro-expressive-code
                         @astrojs/mdx
magic bane
mossy timber
#

we are working on the same project, but I just realized i have astro globally installed, so that's why it's different for me

#

I just updated and seeing the same thing still with node 22.9.0

magic bane
magic bane
#

This might not be more than a vscode thing ๐Ÿค” i've had this issue a few times with the newer versions of code

#

The way to see if it is indeed updating would be to open the .d.ts for astroDB tables before and after and compare them. if the after version has the change, but your vscode editor is not seeing it, it is VSCode not updating when the .d.ts file has been.

mossy timber
#

Tried that, and still the same outdated db-types.d.ts. Also @charred eagle is using neovim i believe and seeing the same thing

magic bane
#

Could you guys please make a minimal reproduction and duplicate the current issue, so our support team can better assist with solving the issue? It is hard to help without even a basic example of whats going on.

From personal experience i haven't had this issue, and i pretty much live with AstroDB... (its on almost all of my current projects). I feel like there is something else preventing this from working correctly.