rouuuge
(...)
January 20, 2021, 5:55pm
1
hi,
I installed the npm package uuid. Now I like to generate a new id like:
const { v4: uuidv4 } = require('uuid');
console.log(uuidv4());
but this produce following error:
TypeError: 'slice' is not a function
at rng (node_modules/uuid/dist/rng.js:29:10)
at exports (function.js:12:15)
at apply (<native code>)
at function_wrapper.js:5:9
at <anonymous>:11:1
Is it not possible to use this package?
if not, how can I generate a new uuid string?
thx
Hi Rouuuge - thanks for posting.
To help us see more details of where the issues lies - would you have a repo to share?
rouuuge
(...)
January 22, 2021, 4:48pm
3
hi,
Currently not possible to share it but here a small snipped how to repoduce my realm-function:
exports = async function() {
const { v4: uuidv4 } = require('uuid');
console.log(uuidv4());
}
and following node-modules that I imported:
{
"dependencies": {
"dayjs": "^1.9.3",
"uuid": "^8.3.2"
}
}
thx for help!