appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK ๐Ÿงก
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
273 stars 59 forks source link

๐Ÿ› Bug Report: #43

Closed JacksonToomey closed 1 year ago

JacksonToomey commented 1 year ago

๐Ÿ‘Ÿ Reproduction steps

Create a basic svelte app and create a client pointing at the local version of appwrite. Create a project and add the web platform with the hostname as localhost. (NOTE: This happens when the hostname is a wildcard *)

<script lang="ts">
  import { Client, Account, ID } from 'appwrite';
  import { onMount } from 'svelte';
  const client = new Client().setEndpoint('http://localhost/v1').setProject('<project id>')
  const account = new Account(client);
  onMount(async () => {
    const user = await account.get();
    console.log(user);
  })
</script>

<div>App</div>

๐Ÿ‘ Expected behavior

The account.get() call should return the currently logged in user if any.

๐Ÿ‘Ž Actual Behavior

The request fails with a CORS error related to the x-sdk-language header.

image

๐ŸŽฒ Appwrite version

Version 0.10.x

๐Ÿ’ป Operating system

MacOS

๐Ÿงฑ Your Environment

No response

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

๐Ÿข Have you read the Code of Conduct?

JacksonToomey commented 1 year ago

๐Ÿ˜ฌ It seems the new version of Appwrite did not overwrite the old version, which caused this error.