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/uuid references @types/node

See original GitHub issue

Unfortunately I’m trying to use this library with Typescript, so I need to use @types/uuid, but that contains a reference to Buffer in globals.d.ts which means it pulls in @types/node, which breaks my build. I’m writing code for browsers, not node.

There would be a few possible fixes for this, including just removing the reference to Buffer and just using Array / ArrayLike - or creating an interface for Buffer instead of pulling in the one from node…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sam-s4scommented, Sep 23, 2019

Oh that would be excellent 😃

So the problem for me is purely in the DefinitelyTyped @types/uuid definition from what I can tell. Inside that type it pulls in a reference to @types/node, because of Buffer - which is located in the node globals.d.ts.

But as I’m doing browser development (not making a node app) I can’t use anything from here, and the presence of those types breaks things like setTimeout (makes its return type NodeJS.Timer instead of number).

This is a problem that has come up a few times before in other projects, and it’s one of the pains of the ecosystem 😦 It normally just requires someone to sort of the types to remove that dependency.

Let me know if you need any more info, and thank you for the reply!

1reaction
ctavancommented, Feb 25, 2020

@types/uuid@7.0.0 has finally been released and should fix this issue. Feel free to create a new issue if you feel that this problem has not been solved yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@types/uuid - npm
Start using @types/uuid in your project by running `npm i @types/uuid`. There are 3615 other projects in the npm registry using @types/uuid.
Read more >
@types/node-uuid | Yarn - Package Manager
This package contains type definitions for node-uuid.js (https://github.com/broofa/node-uuid). Details. Files were exported from https://github.
Read more >
Microsoft/TypeScript - Gitter
I should have to specify "types": [ "uuid" ] for that to work ... I think the problem is that @types/uuid shouldn't reference...
Read more >
visual studio / typescript typings errors - Stack Overflow
answer is: "Under the covers, we run the TypeScript compiler as a task. The command we use is: tsc -p ." I run...
Read more >
Generate unique id typescript - Caritas Castellaneta
Reference id format for Direct Debit Payments The format of reference_id will ... in list components. ts file, run npm to install the...
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