When attempting to use puppeteer with TypeScript and setting esModuleInterop=true in tsconfig.json, an error occurs stating
puppeteer.launch is not a function
If I try to import puppeteer using
import * as puppeteer from "puppeteer"
My question is: Is this the intended behavior or a bug?
It's easy for me to resolve by simply setting esModuleInterop to false, but it does seem strange.
In addition:
If I manually change puppeteer.launch()
to puppeteer.default.launch()
in index.js, it works.
Links:
tsconfig.json: https://pastebin.com/6xvkfJg2
package.json: https://pastebin.com/ViwfMwyQ
index.ts: https://pastebin.com/GtHuiHSJ
index.js: https://pastebin.com/TzeCDiGn