Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The homepage Deno example fails to run #47

Closed
mybuddymichael opened this issue Aug 23, 2021 · 2 comments
Closed

The homepage Deno example fails to run #47

mybuddymichael opened this issue Aug 23, 2021 · 2 comments

Comments

@mybuddymichael
Copy link

Attempting to run this simple example from the homepage fails:

import ShortUniqueId from 'https://cdn.jsdelivr.net/npm/short-unique-id@latest/src/index.ts';

const uid = new ShortUniqueId();

console.log(uid)

Deno complains:

error: An unsupported media type was attempted to be imported as a module.
  Specifier: https://cdn.jsdelivr.net/npm/short-unique-id@latest/package.json
  MediaType: Json

It appears that Deno does not yet support JSON modules.

@mybuddymichael
Copy link
Author

I just instead used import ShortUniqueId from 'https://esm.sh/short-unique-id'; (per Deno's docs on imports) and that worked fine.

@jeanlescure
Copy link
Collaborator

I've gone ahead and updated the docs on this and this other commit.

Also published a release in order to update npm and the website docs.

Cheers for the contribution @mybuddymichael 🚀

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

No branches or pull requests

2 participants