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

Failed to import - @supabase/supabase-js

Open roseMix opened this issue 4 years ago • 2 comments

Failing module

  • GitHub: https://github.com/supabase/supabase-js
  • npm: https://www.npmjs.com/package/@supabase/supabase-js
import { createClient } from "https://esm.sh/@supabase/supabase-js"

Error message

After running deno run I get this:

error: Relative import path "@supabase/gotrue-js" not prefixed with / or ./ or ../ from "https://cdn.esm.sh/v57/@supabase/[email protected]/dist/main/lib/types.d.ts"

Additional info

  • esm.sh version: v57
  • Deno version: 1.15.3

roseMix avatar Nov 03 '21 17:11 roseMix

@roseMix try ?no-check argument, i'll look into it! thanks

ije avatar Nov 03 '21 17:11 ije

Thanks @ije works to get by original error, but now I'm getting this:

ReferenceError: XMLHttpRequest is not defined
    at https://cdn.esm.sh/v57/[email protected]/deno/cross-fetch.js:2:7654
    at new Promise (<anonymous>)
    at _ (https://cdn.esm.sh/v57/[email protected]/deno/cross-fetch.js:2:7522)
    at https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:861
    at new Promise (<anonymous>)
    at https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:841
    at Generator.next (<anonymous>)
    at https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:356
    at new Promise (<anonymous>)
    at y (https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:153)

As far as I know there no known polyfill for XMLHttpRequest so I assume it's just unfixable at this point.

Thanks anyways!

roseMix avatar Nov 03 '21 17:11 roseMix

Thanks @ije works to get by original error, but now I'm getting this:

ReferenceError: XMLHttpRequest is not defined
    at https://cdn.esm.sh/v57/[email protected]/deno/cross-fetch.js:2:7654
    at new Promise (<anonymous>)
    at _ (https://cdn.esm.sh/v57/[email protected]/deno/cross-fetch.js:2:7522)
    at https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:861
    at new Promise (<anonymous>)
    at https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:841
    at Generator.next (<anonymous>)
    at https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:356
    at new Promise (<anonymous>)
    at y (https://cdn.esm.sh/v57/@supabase/[email protected]/deno/gotrue-js.js:2:153)

As far as I know there no known polyfill for XMLHttpRequest so I assume it's just unfixable at this point.

Thanks anyways!

There is a package called xhr on https://deno.land/x/xhr

wangbinyq avatar Sep 27 '22 02:09 wangbinyq

now we add the xhr polyfill automatically for corss-fetch

ije avatar Mar 23 '23 12:03 ije