serpapi / serpapi-javascript

Scrape and parse search engine results using SerpApi.
https://serpapi.com
MIT License
45 stars 4 forks source link

Uncaught (in promise) Error: Module not found "node:https". #20

Open harrisrobin opened 8 months ago

harrisrobin commented 8 months ago

Hi, when trying to use serpapi with Deno

import * as serpapi from "https://deno.land/x/serpapi@2.0.0/mod.ts";

I run into the following error:

error: Uncaught (in promise) Error: Module not found "node:https".
      const ret = new Error(getStringFromWasm0(arg0, arg1));
                  ^
    at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:513:19)
    at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1559899)
    at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1398157)
    at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1895031)
    at __wbg_adapter_40 (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:229:6)
    at real (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:213:14)

I'm new to Deno, and not sure what I'm doing wrong. Any ideas?

zyc9012 commented 8 months ago

@harrisrobin Which version of Deno are you using?

harrisrobin commented 8 months ago

@harrisrobin Which version of Deno are you using? deno 1.37.2

node v18.15.0

Some more info:

this happens specifically when i try to deploy my supabase edge function and downgrading to serpapi 1.1.1 solved the issue for me which is okay for now.

zyc9012 commented 8 months ago

@harrisrobin It turns out that supabase cli doesn't support building edge function that imports modules with node specifiers for now.

I've created an issue there: https://github.com/supabase/cli/issues/1640

harrisrobin commented 8 months ago

@harrisrobin It turns out that supabase cli doesn't support building edge function that imports modules with node specifiers for now.

I've created an issue there: supabase/cli#1640

thanks for looking into it. i subscribed to the issue