lucacasonato / deno-puppeteer

A port of puppeteer running on Deno
https://deno.land/x/puppeteer
MIT License
451 stars 40 forks source link

Fix: use node specifier for path module to fix the error: Error: JSHandle#uploadFile can only be used in Node-like environments. #75

Open cavoirom opened 1 year ago

cavoirom commented 1 year ago

The puppeteer-core is depending on Node.js. We got error: JSHandle#uploadFile can only be used in Node-like environments when we want to upload file using puppeteer.

deno v1.30 provides node: specifier to use in this case.

We have an open issue regarded to this PR: #62

devingfx commented 1 year ago

Hi, thx pointing out this... A workaround that is working until PR is merged: is to set this in deno.json's imports:

        "imports": {
        "path": "node:path",
        "fs": "node:fs",
        "puppeteer": "https://deno.land/x/puppeteer@16.2.0/mod.ts"
    }