Skip to content

UUID package import error when testing with Jest #3629

@JPStrydom

Description

@JPStrydom

TL;DR:
When unit testing with Jest 30.2.0 and Feathers 5.0.36, I get this error:

Image

Description

I'm running a Node 24 project.

I'm using "type": "module", in my package.json file:

  "type": "module",
  "main": "lib/index",
  "keywords": [
    "feathers"
  ],
  "feathers": {
    "language": "js",
    "packager": "npm",
    "database": "other",
    "framework": "koa",
    "transports": [
      "rest"
    ],
    "schema": "typebox"
  },
  "directories": {
    "lib": "src",
    "test": "test"
  },

I'm using Jest 30.2.0 to test.
This is my jest.config.js file:

export default {
  clearMocks: true,
  collectCoverage: true,
  collectCoverageFrom: ['./src/**/*.js', '!./src/**/index.js'],
  coverageProvider: 'v8',
  coverageReporters: ['clover', 'json', 'lcov', 'text', 'cobertura'],
  coverageThreshold: { global: { statements: 94, branches: 83, functions: 93, lines: 94 } },
  globalSetup: './jest.global-setup.mjs',
  globalTeardown: './jest.global-teardown.mjs',
  testTimeout: 10_000,
  transform: {}
}

This is my Jest command:

"test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --silent",

The tests worked before the Feathers upgrade, so it seems something there is not playing along nicely with my tests anymore. Anyone know of a solution to this error?

Happy to provide more info if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions