Closed frostzt closed 3 years ago
Hi, could you please create a repository with reproduction? It's not clear from description where the issue comes from.
Works for me.
$ cat package.json
{
"name": "uuid_es6",
"version": "1.0.0",
"type": "module",
"main": "index.js",
"dependencies": {
"uuid": "8.3.2"
}
}
$ cat index.js
import {v4} from 'uuid';
console.log(v4());
$ node --version
v14.16.1
$ node index.js
77499efc-e6da-4ff3-9495-b210664c308a
Closing per our stated policy. 'Will reopen if/when OP provides a Minimal, Complete, and Verifiable example.
Describe the bug
require is not defined
andexports is not defined
in console if used for node or es6 syntax both. I am using typescript 4.2 but the problem pops up as I import uuid and goes away if removed!How to reproduce
Can be reproduced for both
require is not defined
andexports is not defined
. To reproduce simply import using es6 syntax:import { v4 } from 'uuid';
Expected behavior
Expected
v4()
to generate auuid
but instead it crashed the entire application!Runtime
Additional information
[Any other information or comments that you think will help]