tslib_1 is not defined when using typescript
See original GitHub issueHi The following row is raising the error bellow when using typescript:
const main = await this.page.$x(xpath);
(node:18116) UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: tslib_1 is not defined
at __puppeteer_evaluation_script__:1:16
at ExecutionContext._evaluateInternal (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\ExecutionCo
ntext.js:122:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- ASYNC --
at ExecutionContext.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\helper.js:111:15)
at DOMWorld.evaluate (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\DOMWorld.js:112:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- ASYNC --
at Frame.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\helper.js:111:15)
at Page.evaluate (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\Page.js:863:43)
at Page.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\helper.js:112:23)
at TwitterService.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\dist\twitter\service.js:207:24)
at Generator.next (<anonymous>)
at C:\work\projects\lob\eyez-server-net\node-server\node_modules\tslib\tslib.js:110:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\work\projects\lob\eyez-server-net\node-server\node_modules\tslib\tslib.js:106:16)
at TwitterService.scrollDown (C:\work\projects\lob\eyez-server-net\node-server\dist\twitter\service.js:206:24)
at TwitterService.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\dist\twitter\service.js:111:24)
-- ASYNC --
at Page.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\node_modules\puppeteer\lib\helper.js:111:15)
at TwitterService.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\dist\twitter\service.js:207:24)
at Generator.next (<anonymous>)
at C:\work\projects\lob\eyez-server-net\node-server\node_modules\tslib\tslib.js:110:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\work\projects\lob\eyez-server-net\node-server\node_modules\tslib\tslib.js:106:16)
at TwitterService.scrollDown (C:\work\projects\lob\eyez-server-net\node-server\dist\twitter\service.js:206:24)
at TwitterService.<anonymous> (C:\work\projects\lob\eyez-server-net\node-server\dist\twitter\service.js:111:24)
at Generator.next (<anonymous>)
at fulfilled (C:\work\projects\lob\eyez-server-net\node-server\node_modules\tslib\tslib.js:107:62)
(node:18116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an
async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
This is the package.json
:
"dependencies": {
"@types/puppeteer": "^2.0.0",
"compression": "^1.7.4",
"express": "^4.17.1",
"helmet": "^3.21.2",
"puppeteer": "^2.0.0",
"tslib": "^1.10.0"
},
"devDependencies": {
"@types/compression": "^1.0.1",
"@types/express": "^4.17.2",
"@types/helmet": "0.0.45",
"@types/jest": "^24.0.21",
"@types/node": "^12.12.5",
"eslint": "^6.6.0",
"jest": "^24.9.0",
"typescript": "^3.6.4"
}
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
tslib_1 is not defined #18039 - microsoft/TypeScript - GitHub
I have install tslib and set "importHelpers": true to tsconfig.json file. Am I missing something? The Error. Exception has occurred: Error Error: Error: ......
Read more >Error: "Evaluation failed: ReferenceError: tslib_1 is not defined ...
I have written a puppeteer test case where I am trying to read card title as soon as it matches with specific id...
Read more >@rollup/plugin-typescript - npm
Start using @rollup/plugin-typescript in your project by running `npm i @rollup/plugin-typescript`. There are no other projects in the npm ...
Read more >Documentation - Integrating with Build Tools - TypeScript
ts files out-of-the-box. It only performs transpilation and not type checking. It also requires that some compilerOptions have certain values. See the Vite...
Read more >How to Setup a TypeScript + Node.js Project | Khalil Stemmler
json is where we define the TypeScript compiler options. We can create a tsconfig with several options set. npx tsc --init --rootDir src...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into this as well. I was not able to work around it by setting my
target
toesnext
so the nativeawait
is being used instead of thetslib1.__awaiter
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!