directus / v8-archive

Directus Database API — Wraps Custom SQL Databases with a REST/GraphQL API
https://docs.directus.io/api/reference.html
507 stars 203 forks source link

Uncaught TypeError: DirectusSDK is not a constructor #2332

Open pwFoo opened 4 years ago

pwFoo commented 4 years ago

Hi,

I used the old SDK version linked in the documentation: https://docs.directus.io/guides/js-sdk.html

<script src="https://unpkg.com/@directus/sdk-js@5.3.4/dist/directus-sdk.umd.min.js"></script>

<script>
  const client = new DirectusSDK();
</script>

I tried to update to the latest version found here: https://unpkg.com/browse/@directus/sdk-js/dist/umd/directus-sdk.js

Now I get the error message

Uncaught TypeError: DirectusSDK is not a constructor

There is no documentation about changes and how to use the latest SDK version?!

doughnet commented 4 years ago

Yeah the documentation seems to be extremely lacking information in my opinion. I've been trying to figure this out but with bad documentation that doesn't show an actually properly constructed page using the SDK it seems very lacking.

I'm finding most of the SDK documentation is lacking or assumes that you know where their little snippet is intended to go .