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.

Version 8.1 won't load using legacy require('uuid/v4')

See original GitHub issue

For some reason the v4.js ,v3.js etc files were removed (in 8.x?) and now code that’s worked fine for a long time no longer works because it was written before const { v4: uuidv4 } = require('uuid'); was a thing and require('uuid/v4') was the way to do it. And its not like I can just go though 300+ files in multiple projects and just change it oh and some of this still needs to run on older versions of node due to circumstances out of my control. And yes I can just lock down the version to 7.x but in a large development group just tweaking a global file like package.json requires sign off etc. and all the while builds are halted while we go on a fire drill so please realize you’re not in a bubble and willy nilly remove stuff because its old or whatever.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
broofacommented, May 26, 2020

using “*” for the version was thought a good idea

image

0reactions
LinusUcommented, May 27, 2020

uuid was one of those modules that is so simple (supposedly) that using “*” for the version was thought a good idea to keep it up to date.

I would say that this is never a good idea. With the same logic, you could have thought that “the module was so simple so it will never have a breaking change”, and thus you could have pinned it at ^1.0.0

The fix here is simple, never use "*" for your dependencies, as that will introduce the kinds of problem that you posted about. That goes for all dependencies…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate RFC-compliant UUIDs in JavaScript - GitHub
Complete - Support for RFC4122 version 1, 3, 4, and 5 UUIDs; Cross-platform - Support ... Install. npm install uuid. 2. Create a...
Read more >
Can't resolve 'uuid/v4' in react-native - Stack Overflow
This error happens because of the file structure in node_modules/uuid, if you look there is no longer a uuidv4 to import and instead...
Read more >
Universally unique identifier - Wikipedia
A universally unique identifier (UUID) is a 128-bit label used for information in computer systems. The term globally unique identifier (GUID) is also...
Read more >
uuidv4 - npm
Quick start. First you need to integrate uuidv4 into your project by using the require function: const { uuid } ...
Read more >
Conan Documentation
Conan can create, upload and download binaries with the same ... all packages and not requiring a different solution for every different operating...
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