esm-dev / esm.sh

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

Failed to import - sucrase@3.20.3 #265

Open elisee opened 2 years ago

elisee commented 2 years ago

Failing module

import { transform } from "https://esm.sh/sucrase@3.20.3";

// 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/sucrase@3.20.3?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/sucrase@3.20.3/deno/sucrase.js:133:4807)
    at vk (https://cdn.esm.sh/v66/sucrase@3.20.3/deno/sucrase.js:133:4138)
    at .../test.ts:3:1

Additional info

nihgwu commented 2 years ago

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

renhiyama commented 1 year ago

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