[Question] TypeScript compilation must include the browser environment
See original GitHub issueIn 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:
- Created 3 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top 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 >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
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.@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.