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

HTML Depends on TypeScript #253

Open
2 of 6 tasks
lishaduck opened this issue Feb 26, 2025 · 3 comments
Open
2 of 6 tasks

HTML Depends on TypeScript #253

lishaduck opened this issue Feb 26, 2025 · 3 comments

Comments

@lishaduck
Copy link

lishaduck commented Feb 26, 2025

Latest versions.

For which package is this issue?

HTML

Describe the issue in a sentence or two.

The HTML package depends on TypeScript, despite only using as a Dev Dep

Issue Type (Can be multiple)

  • Build - Can’t install or import the SDK
  • Performance - Performance issues
  • Behaviour - Functions aren’t working as expected
  • Documentation - Inconsistency between the docs and behaviour
  • Incorrect Types
  • Other (Install)

Steps to reproduce

https://www.npmjs.com/package/@cloudinary/html?activeTab=dependencies

Error screenshots

n/a

Browsers (if issue relates to UI, else ignore)

n/a

Versions and Libraries (fill in the version numbers)

package SDK version
Node - n/a (Deno)
NPM - n/a (Deno)

Config Files (Please paste the following files if possible)

package.json (n/a)

deno.json (trimmed for brevity):

{
  "nodeModulesDir": "auto",
  "imports": {
    "@biomejs/biome": "npm:@biomejs/biome@^1.9.4",
    "@cloudinary/react": "https://esm.sh/@cloudinary/react@1.14.0?external=*",
    "@cloudinary/url-gen": "npm:@cloudinary/url-gen@^1.21.0",
    "@fresh/plugin-tailwind": "jsr:@fresh/plugin-tailwind@^0.0.1-alpha.7",
    "@preact/signals": "npm:@preact/signals@^1.3.2",
    "fresh": "jsr:@fresh/core@^2.0.0-alpha.29",
    "preact": "npm:preact@^10.26.2",
    "tailwindcss": "npm:tailwindcss@^3.4.17"
  },
  "scopes": {
    "https://esm.sh/": {
      "@cloudinary/hrml": "npm:@cloudinary/html@",
      "@types/react": "npm:preact@10.26.2/compat",
      "client-only": "npm:client-only@0.0.1",
      "react": "npm:preact@10.26.2/compat",
      "react/jsx-runtime": "npm:preact@10.26.2/jsx-runtime",
      "react-dom": "npm:preact@10.26.2/compat",
      "react-dom/test-utils": "npm:preact@10.26.2/test-utils"
    }
  }
}

Repository

n/a

@lishaduck
Copy link
Author

Also, isBrowser is based on window instead of document, which means it's incorrect while running on Deno (and other modern runtimes).

export function isBrowser(): boolean{
return typeof window !== 'undefined';
}

@lishaduck
Copy link
Author

And there's no exports field, so it can't get consumed as ESM and it doesn't use .mjs extension for ESM so it probably can't be imported even with an exports field.

I'd be happy to help clean it up in a month (project I'm using cloudinary for is very far behind).

@dannyv-cloudinary
Copy link
Contributor

Hi @lishaduck.
Thanks for your comments. We will review this internally and get back to you.

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