Skip to content

[JS] Tests fail with node 23. #1995

@yesudeep

Description

@yesudeep

Describe the bug
JS unit tests fail with node version 23.

To Reproduce

zsh❯ nvm use 23
Now using node v23.8.0 (npm v10.9.2)

Fri Feb 14 2025  7:11PM (PST-0800) yesudeep@vikata.local on Darwin 24.3.0 arm64 
genkit on  yesudeep/fix/biome [$!?]  Yesudeep Mangalapilly [yesudeep@google.com] via  v23.8.0 
zsh❯ pnpm test:js

> genkit@ test:js /Users/yesudeep/code/github.com/firebase/genkit
> cd js && pnpm i && pnpm test:all

Scope: all 47 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 535ms

> @ test:all /Users/yesudeep/code/github.com/firebase/genkit/js
> pnpm -r --workspace-concurrency 0 -F "./(ai|core|plugins|genkit)/**" test && pnpm test:esm

Scope: 17 of 47 workspace projects
core test$ node --import tsx --test tests/*_test.ts
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/action_test.ts (291.508291ms)
│ ▶ LazyPromise
│   ✔ call its function lazily (0.314625ms)
│ ✔ LazyPromise (0.659208ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/context_test.ts (295.025375ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/flow_test.ts (272.461917ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/registry_test.ts (287.117916ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/schema_test.ts (232.552917ms)
│ ℹ tests 6
│ ℹ suites 1
│ ℹ pass 1
│ ℹ fail 5
│ ℹ cancelled 0
│ ℹ skipped 0
│ ℹ todo 0
│ ℹ duration_ms 301.629875
│ ✖ failing tests:
│ test at tests/action_test.ts:1:1
│ ✖ tests/action_test.ts (291.508291ms)
│   'test failed'
│ test at tests/context_test.ts:1:1
│ ✖ tests/context_test.ts (295.025375ms)
│   'test failed'
│ test at tests/flow_test.ts:1:1
│ ✖ tests/flow_test.ts (272.461917ms)
│   'test failed'
│ test at tests/registry_test.ts:1:1
│ ✖ tests/registry_test.ts (287.117916ms)
│   'test failed'
│ test at tests/schema_test.ts:1:1
│ ✖ tests/schema_test.ts (232.552917ms)
│   'test failed'
└─ Failed in 339ms at /Users/yesudeep/code/github.com/firebase/genkit/js/core
/Users/yesudeep/code/github.com/firebase/genkit/js/core:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @genkit-ai/core@1.0.4 test: `node --import tsx --test tests/*_test.ts`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Expected behavior
Tests should pass.

Screenshots
Image

Runtime (please complete the following information):

  • OS: macOS, Linux
  • Version: Sequoia 15.3.1 arm64

** Node version

zsh❯ node --version
v23.8.0

Additional context

Metadata

Metadata

Labels

bugSomething isn't workingjs

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions