question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] TypeScript compilation must include the browser environment

See original GitHub issue

In order to get a successful TypeScript compilation, the dom types must be included (previously mentioned in https://github.com/microsoft/playwright/issues/2659#issuecomment-647108753).

Doing that results in TypeScript allowing access to browser globals such as window, document, URL and many more, which do not really exist in Node.js.

Is this recognized as an issue that would possibly be addressed, please?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
JoelEinbindercommented, Jul 24, 2020

We’ve seen a lot of value from having page.evaluate be typed, and doing so requires having the browser globals. Moving evaluation to be string only would be a huge change to the project, so I’m closing this as wontfix.

3reactions
mightyiamcommented, Jul 26, 2020

@JoelEinbinder I am not for the parameter of page.evaluate to be a string only. If anything, I am asking to not have browser globals in my TypeScript Node.js project in order to use Playwright. Please do not close for a misunderstanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get rid of the warning .ts file is part of the TypeScript ...
module.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig....
Read more >
TypeScript Compiling with Visual Studio Code
A tsconfig.json file defines the TypeScript project settings, such as the compiler options and the files that should be included. To do this,...
Read more >
Understanding TypeScript's “Compilation Process” & the ...
A compiled TypeScript program can run in an environment that implements its own module systems. For example, AMD (Asynchronous Module Definition) ...
Read more >
TS Playground - An online editor for exploring TypeScript and ...
Disable including any library files, including the default lib.d.ts. ... Emit ECMAScript-standard-compliant class fields. Projects ... Disable preferring source ...
Read more >
Top 50 TypeScript interview questions explained - Educative.io
TypeScript is an open-source superset of JavaScript developed by Microsoft to add additional features without breaking existing programs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found