Skip to content

📚 Documentation: Error in SvelteKit Tutorial Step 3 #136

@Mazahir26

Description

@Mazahir26

💭 Description

Description:

In the SvelteKit tutorial under step 3, there is a mistake in the code snippet provided. Specifically, the import statement for the Database and Account object is missing, and the appwrite module exports Databases instead of Database.

Current code:

import { Client } from "appwrite";

const client = new Client();
client
  .setEndpoint("https://cloud.appwrite.io/v1")
  .setProject("<YOUR_PROJECT_ID>"); // Replace with your project ID

export const account = new Account(client);
export const database = new Database(client);

Suggested correction:

import { Client, Databases, Account } from "appwrite"; // Added Databases & Account import

const client = new Client();
client
  .setEndpoint("https://cloud.appwrite.io/v1")
  .setProject("<YOUR_PROJECT_ID>");

export const account = new Account(client);
export const database = new Databases(client); // Changed to Databases

This adjustment ensures that the code functions as expected.

Steps to Reproduce:

  1. Go to the SvelteKit tutorial step 3.
  2. Follow the provided code snippet.

Expected Behavior:

The code provided should be accurate and functional.

Additional Information:

Documentation URL: https://appwrite.io/docs/tutorials/sveltekit/step-3

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions