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

Failed to import - [email protected]

Open elisee opened this issue 3 years ago • 2 comments

Failing module

  • GitHub: https://github.com/alangpierce/sucrase
  • npm: https://www.npmjs.com/package/sucrase
import { transform } from "https://esm.sh/[email protected]";

// This throws (esm.sh v59-v66)
transform("test();", { transforms: [] });

This used to work. I tried pinning a bunch of older versions and finally got it working with v58:

import { transform } from "https://esm.sh/[email protected]?pin=v58";

// This works (esm.sh v58)
transform("test();", { transforms: [] });

Error message

After running deno run I got this:

error: Uncaught TypeError: Ki.default is not a constructor
    at Ui (https://cdn.esm.sh/v66/[email protected]/deno/sucrase.js:133:4807)
    at vk (https://cdn.esm.sh/v66/[email protected]/deno/sucrase.js:133:4138)
    at .../test.ts:3:1

Additional info

  • esm.sh version: v66
  • Deno version: 1.18.2 (release, x86_64-pc-windows-msvc)

elisee avatar Feb 09 '22 11:02 elisee

I think it's the same issue as https://github.com/vitejs/vite/issues/7112, probably caused by esbuild

nihgwu avatar Mar 06 '22 16:03 nihgwu

@elisee @nihgwu could you retry with the newer versions of both sucrase & esm.sh?

renhiyama avatar May 19 '23 17:05 renhiyama