问题
I have included puppeteer-core
as a dependency in my TypeScript project, and am using Visual Studio 2019. When I try to build the project, I get this error below (as shown by the red squiggly underline under Element
):
error TS2304: Build:Cannot find name 'Element'
How can I resolve this please?
回答1:
Adding dom
to my tsconfig.json
got rid of the issue:
{
"compilerOptions": {
"lib": [
"es2018",
"dom"
]
}
}
来源:https://stackoverflow.com/questions/57999416/typescript-puppeteer-library-error-cannot-find-name-element