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

Failed to import - preact/hooks types #149

Closed
yishn opened this issue Sep 16, 2021 · 2 comments
Closed

Failed to import - preact/hooks types #149

yishn opened this issue Sep 16, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@yishn
Copy link

yishn commented Sep 16, 2021

Failing module

import { useState } from 'https://esm.sh/preact/hooks'

It seems like the x-typescript-types header sent by esm.sh are incorrect:

image

It should be https://cdn.esm.sh/v51/[email protected]/hooks/src/index.d.ts instead.

Error message

After running deno run I get this:

error: Error: Unable to resolve media type for specifier: "https://cdn.esm.sh/v51/[email protected]/hooks...d.ts"
    at deno:core/01_core.js:106:46
    at unwrapOpResult (deno:core/01_core.js:126:13)
    at Object.opSync (deno:core/01_core.js:140:12)
    at Object.resolveModuleNames (deno:cli/tsc/99_main_compiler.js:343:29)
    at actualResolveModuleNamesWorker (deno:cli/tsc/00_typescript.js:109500:133)
    at resolveModuleNamesWorker (deno:cli/tsc/00_typescript.js:109763:26)
    at resolveModuleNamesReusingOldState (deno:cli/tsc/00_typescript.js:109860:24)
    at processImportedModules (deno:cli/tsc/00_typescript.js:111315:35)
    at findSourceFileWorker (deno:cli/tsc/00_typescript.js:111116:17)
    at findSourceFile (deno:cli/tsc/00_typescript.js:110977:26)

Additional info

  • esm.sh version: v51
  • Deno version: 1.13.2
@yishn yishn added the bug Something isn't working label Sep 16, 2021
@lucacasonato
Copy link
Contributor

Having the same issue with https://esm.sh/[email protected]/sheets

@ije ije closed this as completed in dc6f751 Sep 16, 2021
@ije
Copy link
Member

ije commented Sep 16, 2021

fixed in v52, also added preact testing for deno: https://github.com/alephjs/esm.sh/tree/master/test/deno/preact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants