esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
2.95k stars 143 forks source link

Failed to import - @headlessui/react #825

Open nanikit opened 2 months ago

nanikit commented 2 months ago

Background

I tried using @headlessui/react with deno lsp like the following and noticed lsp didn't work.

import { Combobox } from "https://esm.sh/@headlessui/react@1.7.19?external=react,react-dom";

Steps to reproduce

// @deno-types="https://esm.sh/v135/@headlessui/react@1.7.19/X-ZS9yZWFjdCxyZWFjdC1kb20/dist/index.d.ts"
export { Combobox } from "@headlessui/react";

Expected behavior

I can go to type definition of Combobox.

Actual behavior

Module not found "https://esm.sh/v135/client-only@0.0.1/index.d.ts". at https://esm.sh/v135/@headlessui/react@1.7.19/X-ZS9yZWFjdCxyZWFjdC1kb20/dist/index.d.ts:1:8

Actually the content of https://esm.sh/v135/client-only@0.0.1/index.d.ts is Types not found.

MaDsEm88 commented 1 month ago

@nanikit have you tried this - https://esm.sh/@headlessui/react@latest?alias=react:preact/compat,react-dom:preact/compat,@types/react:preact/compat

nanikit commented 1 month ago

I just tried and it didn't work.

I also have tried importing headlessui with npm dependency and preact, and found it is not designed to be used with preact. preact compat is not complete.

MaDsEm88 commented 1 month ago

@nanikit strange as it works just fine inside the Fresh.deno framework which uses preact. Might have to test it out later