Ethan's dev spotEds
Ethan's dev spotโ€ข3y agoโ€ข
44 replies
Trevor

BETH stack tutorial blocked "Sync is not supported in databases opened in file mode."

After creating a Turso db and adding the needed
.env
variables running
bun dev
results in the follwing error.

$ concurrently "bun run --hot src/main.ts" "bun run uno:dev" "bun run liveReload"
[1] $ bunx --bun unocss --watch
[2] $ bunx beth-stack
[2] ๐ŸฆŠ Livereload running localhost:3001
[0] 73 |       },
[0] 74 |     });
[0] 75 |   }
[0] 76 | 
[0] 77 |   sync() {
[0] 78 |     databaseSyncSync.call(this.db);
[0]         ^
[0] error: Sync is not supported in databases opened in file mode.
[0]       at sync (/Users/trevorfehrman/Documents/Code/Personal/beth-app/node_modules/libsql/index.js:78:4)
[0]       at /Users/trevorfehrman/Documents/Code/Personal/beth-app/node_modules/@libsql/client/lib-esm/sqlite3.js:93:14
[0]       at sync (/Users/trevorfehrman/Documents/Code/Personal/beth-app/node_modules/@libsql/client/lib-esm/sqlite3.js:91:17)
[0]       at /Users/trevorfehrman/Documents/Code/Personal/beth-app/src/db/index.ts:23:6
      at processTicksAndRejections (:55:76)
[0] 73 |       },
[0] 74 |     });
[0] 75 |   }
[0] 76 | 
[0] 77 |   sync() {
[0] 78 |     databaseSyncSync.call(this.db);
[0]         ^
[0] error: Sync is not supported in databases opened in file mode.
[0]       at sync (/Users/trevorfehrman/Documents/Code/Personal/beth-app/node_modules/libsql/index.js:78:4)
[0]       at /Users/trevorfehrman/Documents/Code/Personal/beth-app/node_modules/@libsql/client/lib-esm/sqlite3.js:93:14
[0]       at sync (/Users/trevorfehrman/Documents/Code/Personal/beth-app/node_modules/@libsql/client/lib-esm/sqlite3.js:91:17)
[0]       at /Users/trevorfehrman/Documents/Code/Personal/beth-app/src/db/index.ts:23:6
[0]       at processTicksAndRejections (:55:76)
[1] unocss v0.55.7
[1] โ— UnoCSS in watch mode...
[1] โ„น Watching for changes in src/**/*.{ts,tsx}

Nothing is getting served to
localhost:3000
but a
GET
request to
localhost:3001
returns a 404 not found honk_thonk

I guess I have 2 questions:
1. Why is this command spinning something up on 3001? I've ensured there's nothing running on 3000.
2. It seems like the problem is in the
libsql
package within node modules. Not sure if this is related to issue I was having with Bun installing the wrong version of esbuild for my CPU architecture or if that's a coincidence.

Once again, appreciate any thoughts anyone might have.

Thanks!
Was this page helpful?