esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

Failed to import - react-fontawesome imports `cdn.esm.shreact`

Open crowlKats opened this issue 3 years ago • 6 comments

Failing module

  • GitHub: https://github.com/FortAwesome/react-fontawesome
  • npm: https://www.npmjs.com/package/@fortawesome/react-fontawesome
import { FontAwesomeIcon } from 'https://esm.sh/@fortawesome/[email protected]'

Error message

After running deno run I get this:

/* your error log here */
Download https://cdn.esm.shreact/
error: AssertionError: "data" is unexpectedly null for "https://cdn.esm.shreact/".

The AssertionError is "expected", as tsc isn't emitting something that it is expected

Additional info

  • esm.sh version: v59
  • Deno version: 1.17.1

crowlKats avatar Dec 30 '21 11:12 crowlKats

I can not repeat it, more details?

Screen Shot 2022-01-05 at 15 11 33

ije avatar Jan 05 '22 07:01 ije

works fine on v61:

➜ deno eval "import { FontAwesomeIcon } from 'https://esm.sh/@fortawesome/[email protected]'"
Download https://esm.sh/@fortawesome/[email protected]
Download https://cdn.esm.sh/v61/@fortawesome/[email protected]/deno/react-fontawesome.js
Download https://cdn.esm.sh/v61/@fortawesome/[email protected]/index.d.ts
Download https://cdn.esm.sh/v61/@fortawesome/[email protected]/deno/fontawesome-svg-core.js
Download https://cdn.esm.sh/v61/[email protected]/deno/prop-types.js
Download https://cdn.esm.sh/v61/@fortawesome/[email protected]/index.d.ts
Download https://cdn.esm.shreact/
Download https://cdn.esm.sh/v61/@fortawesome/[email protected]/index.d.ts

v1rtl avatar Jan 07 '22 18:01 v1rtl

Sorry for the late reply. Please try to run it in a ts file, or eval with ts, not repl or standard eval. Even in both commands you ran, you can see https://cdn.esm.shreact/, which isnt an existing url

crowlKats avatar Jan 07 '22 23:01 crowlKats

ok I see now:

➜ deno eval --ext=ts "import { FontAwesomeIcon } from 'https://esm.sh/@fortawesome/[email protected]'"
Download https://cdn.esm.shreact/
error: AssertionError: "data" is unexpectedly null for "https://cdn.esm.shreact/".
    at assert (deno:cli/tsc/99_main_compiler.js:71:13)
    at Object.getSourceFile (deno:cli/tsc/99_main_compiler.js:289:7)
    at findSourceFileWorker (deno:cli/tsc/00_typescript.js:115354:29)
    at findSourceFile (deno:cli/tsc/00_typescript.js:115263:26)
    at deno:cli/tsc/00_typescript.js:115215:85
    at getSourceFileFromReferenceWorker (deno:cli/tsc/00_typescript.js:115199:77)
    at processSourceFile (deno:cli/tsc/00_typescript.js:115215:13)
    at deno:cli/tsc/00_typescript.js:115506:17
    at Object.forEach (deno:cli/tsc/00_typescript.js:391:30)
    at processReferencedFiles (deno:cli/tsc/00_typescript.js:115505:16)

v1rtl avatar Jan 08 '22 10:01 v1rtl

i guess it is types problem, i will look into it.

ije avatar Feb 05 '22 19:02 ije

Found another case of this: https://esm.sh/@tensorflow/tfjs-backend-webgpu somewhere deep within it will try to import https://cdn.esm.shwebgl2/

crowlKats avatar Feb 09 '22 02:02 crowlKats