dappeteer undefined
himat opened this issue · 3 comments
himat commented
I installed dappeteer and puppeteer with yarn add dappeteer
and yarn add puppeteer
and yarn add -D @types/puppeteer
.
I then proceeded to run this simple function, but it seems like the dappeteer import is undefined.
TypeError: Cannot read property 'launch' of undefined
My file: minting.ts
import puppeteer from "puppeteer";
import dappeteer from "dappeteer";
export async function run() {
const browser = await dappeteer.launch(puppeteer);
const metamask = await dappeteer.getMetamask(browser);
await browser.close();
}
I saw that in your instructions, you said to install with npm install -s dappeteer
. I'm using yarn, but is the -s
of any significance for npm? I couldn't find it in the npm help. That's probably not the issue though.
❯ yarn -v
1.22.4
❯ node -v
v12.13.0
Is there some kind of more information I can provide to help debug why this is?
himat commented
I don't remember exactly, but I think if I ran it as a .js file it worked
imgnx commented
I was having this same issue. Got it to work with:
const dappeteer = require("@chainsafe/dappeteer");