Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble syncing in Nuxt3 – Embedded Syncs works with Nuxt x Vercel? #1689

Open
mavichow opened this issue Aug 22, 2024 · 0 comments

Comments

@mavichow
Copy link

I've cloned, tested and deploy Nuxt3 to Vercel with this repo: https://github.com/tursodatabase/examples/tree/master/app-top-web-frameworks

Everything works well with remote DB and when I tried to embed the db locally, the replica.db seems like it's empty.

May I know did I missed out any steps?

// server/utils/turso.ts
import { createClient } from "@libsql/client";

export function useTurso() {
  const tursoConfig = useRuntimeConfig().turso;

  if (!tursoConfig.dbUrl || !tursoConfig.dbAuthToken) {
    throw new Error(
      "Please fill the NUXT_TURSO_DB_URL and NUXT_TURSO_DB_AUTH_TOKEN env variables"
    );
  }
  return createClient({
    url : "file:dbs/replica.db",
    syncUrl: tursoConfig.dbUrl,
    authToken: tursoConfig.dbAuthToken,
  });
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant