Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

UUID (v8) causing issues when running tests using Jest #270

Closed as not planned
@tmcdo1

Description

@tmcdo1

Is this a support request?
No

Describe the bug
Running unit tests using Jest throws an error SyntaxError: Unexpected token 'export' related to the uuid module

To reproduce
Steps to reproduce the behavior.
Using TypeScript. Write unit tests using Jest that import LaunchDarkly.

Expected behavior
I expect my tests to run without error

Logs

/node_modules/launchdarkly-node-server-sdk/node_modules/uuid/dist/esm-browser/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as v1 } from './v1.js';
                                                                                      ^^^^^^

SyntaxError: Unexpected token 'export'
 > 1 | import LaunchDarkly, { LDClient } from 'launchdarkly-node-server-sdk';

SDK version
6.4.3

Language version, developer tools
Node: 18.12.1

OS/platform
MacOS 13.1

Additional context
uuid has fixed the issue with v9: uuidjs/uuid#451 (comment)

I have gotten tests to run properly when adding the following to package.json

"overrides": {
    "launchdarkly-node-server-sdk": {
        "uuid": "^9.0.0"
    }
}

Should be able to fix by updating uuid dependency to v9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalewaiting for feedbackIndicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions