aspen-cloud / triplit

A full-stack, syncing database that runs on both server and client. Pluggable storage (indexeddb, sqlite, durable objects), syncs over websockets, and works with your favorite framework (React, Solid, Vue, Svelte).
https://triplit.dev
GNU Affero General Public License v3.0
2.32k stars 69 forks source link

Websocket Error when running using VueJS template #238

Closed yankeeinlondon closed 1 week ago

yankeeinlondon commented 1 week ago
WebSocket connection to 'ws:/?schema=840514468&sync-schema=false&client=hfaEau0ibwSjh_ZHxlpeZ&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ4LXRyaXBsaXQtdG9rZW4tdHlwZSI6ImFub24iLCJ4LXRyaXBsaXQtcHJvamVjdC1pZCI6ImxvY2FsLXByb2plY3QtaWQifQ.JzN7Erur8Y-MlFdCaZtovQwxN_m_fSyOIWNzYQ3uVcc' failed:
  | construct | @ | websocket-transport.js:149 -- | -- | -- | --   | connect | @ | websocket-transport.js:85   | connect | @ | sync-engine.js:270   | Show less

I simply installed the latest VueJS template and then ran the dev environment with npm run dev and got repeating failures to connect.

yankeeinlondon commented 1 week ago

Just to ensure that it wasn't poor old VueJS being ignored, I installed using the React template but same result.

yankeeinlondon commented 1 week ago

Ok nevermind. It appears you need to have the triplet server running the the script dev doesn't start it. Shouldn't it be started automatically?

matlin commented 1 week ago

Hey @yankeeinlondon did you also start the Triplit dev server? Like npx triplit dev. It should start a server listening on port 6543. You need to run this in addition to Vue's dev server.

yankeeinlondon commented 1 week ago

Just did that ... i'd have expected the pnpm dev command to auto start this. Are there situations where you wouldn't want this in dev mode?

yankeeinlondon commented 1 week ago

we can close this issuue I just thought it would be more intuitive if you could "start" by just cloning the template and entering dev mode.