#AstroDB db.d.ts doesn't always update
29 messages ยท Page 1 of 1 (latest)
You can run astro sync or restart your dev server which will automatically run it and regenerate types if anything changed
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
The types not being in sync is almost a constant issue now as soon as we make changes in the tables
I'm seeing this as well
<@&1129102257422610512> any thoughts here?
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?
Only local, so restarting is resetting the entire DB with the seed.ts that we have.
i.e yes we have a seek file ๐
okay that is a good thing, that means sync as far as i've been told should be working ๐ค
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)
do you have a minimal repro i could take i look at? I have a pretty good understanding of astrodb ๐
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
could you run astro info and provide your package.json?
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
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!
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
Your on a older version of astro, first suggestion would be upgrade your packages to latest. second suggestion would be opening your own support thread, unless are you guys working together on the same project but just have different versions of it?
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
I do not recommend installing astro globally, but keeping it per project so weirdness doesnt happen, esp when working with AstroDB, since astroDB version are tied to specific versions. esp with some of the later releases that add support for Turso/libSQL and other bug fixes.
if using VSCode, after the database update is saved and it does the type regen, does using the following fix it?
ctrl + shift + p- Select option
Developer: Restart Extension Host
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.
Tried that, and still the same outdated db-types.d.ts. Also @charred eagle is using neovim i believe and seeing the same thing
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.