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.

@types/node pollution

See original GitHub issue

Prerequisites

Environment check

  • I’m using the latest msw version
  • I’m using Node.js version 14 or higher

Browsers

Chromium (Chrome, Brave, etc.)

Reproduction repository

Unnecessary

Reproduction steps

Just import msw in a typescript project

Current behavior

Import msw will also import @types/node which pollutes types.

For example, after import msw, type of setTimeout is no longer correct:

image

This issue results from type declaration of strict-event-emitter:

image

Removing the first line can fix the bug.

Expected behavior

Not import types of node when using the library in a browser

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jkieboomcommented, Oct 10, 2022

Hmm, not sure what I did when I tested it locally, it’s indeed still there also for me. We also need to set types: [] in the tsconfig. I’ll prepare another PR.

0reactions
kingyue737commented, Oct 9, 2022

@jkieboom It does not appear to be fixed. /// <reference types="node" /> is still there

https://www.unpkg.com/browse/strict-event-emitter@0.2.7/lib/StrictEventEmitter.d.ts

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pollution | Definition, History, Types, & Facts
The major kinds of pollution, usually classified by environment, are air pollution, water pollution, and land pollution.
Read more >
Pollution Facts & Types of Pollution
Another common type of air pollution is dangerous gases, such as sulfur dioxide, carbon monoxide, nitrogen oxides and chemical vapors. These can ...
Read more >
Pollution - Wikipedia
Major forms of pollution include air pollution, light pollution, litter, noise pollution, plastic pollution, soil contamination, radioactive contamination, ...
Read more >
Effects of Various Types of Pollution
Air Pollution; Water Pollution; Soil Pollution; Noise Pollution. Besides these 4 types of pollution, other types exist such as light pollution, thermal ...
Read more >
What Are the 7 Different Types of Pollution?
The 7 Different Types of Pollution · Air Pollution · Water Pollution · Land Pollution · Radioactive Pollution · Noise Pollution · Light...
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