Skip to content

Fix various TS templates#4360

Open
bradleyshep wants to merge 2 commits intomasterfrom
fix-templates
Open

Fix various TS templates#4360
bradleyshep wants to merge 2 commits intomasterfrom
fix-templates

Conversation

@bradleyshep
Copy link
Contributor

Description of Changes

Fix withModuleName -> withDatabaseName in server-side code across multiple TypeScript templates. The 2.0 SDK renamed this method, but several templates still used the old 1.x API name, causing a runtime error (DbConnection.builder(...).withUri(...).withModuleName is not a function).

Files changed:

  • templates/nuxt-ts/server/api/people.get.ts
  • templates/remix-ts/app/lib/spacetimedb.server.ts
  • templates/nextjs-ts/lib/spacetimedb-server.ts
  • templates/nodejs-ts/src/main.ts
  • templates/deno-ts/src/main.ts
  • templates/keynote-2/src/connectors/spacetimedb.ts

API and ABI breaking changes

None. This aligns templates with the existing 2.0 SDK API.

Expected complexity level and risk

1 — Trivial string replacement across template files. No logic changes.

Testing

  • Run spacetime dev --template nuxt-ts and verify the Nuxt SSR server API (/api/people) connects without withModuleName is not a function error
  • Run spacetime dev --template nextjs-ts and verify the server-side SpacetimeDB connection works
  • Run spacetime dev --template remix-ts and verify the server-side SpacetimeDB connection works

Copy link
Contributor

@clockwork-tien clockwork-tien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nuxt changes looks good from my testing (edit: I just now noticed template issue potentially with recent module_bindings updates with Nuxt, but it is unrelated to PR)

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

Successfully merging this pull request may close these issues.

2 participants

Comments