nitrojs / nitrojs/nitro

Nitro nightly@latest doesn't work with "@elastic/elasticsearch": "^9.3.1",

Open
#4,048 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug tanstack v3 vite plugin
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment

NODE 24

Reproduction

install "@elastic/elasticsearch": "^9.3.1" with "nitro": "npm:nitro-nightly@latest",

Describe the bug

After build, when I try to open my tanstack start app it crashes

Additional context

Tanstack Start + Vite 8.0.0-beta.15

Logs
TypeError: Cannot destructure property '__extends' of '__toESM(...).default' as it is undefined.
    at file:///var/task/_libs/@elastic/elasticsearch+%5B...%5D.mjs:16:7
    ... 5 lines matching cause stack trace ...
    at async Object.fetch (file:///var/task/_ssr/ssr.mjs:937:10) {
  cause: TypeError: Cannot destructure property '__extends' of '__toESM(...).default' as it is undefined.
      at file:///var/task/_libs/@elastic/elasticsearch+%5B...%5D.mjs:16:7
      at ModuleJob.run (node:internal/modules/esm/module_job:413:25)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:660:26)
      at async loadEntries (file:///var/task/_ssr/ssr.mjs:688:22)
      at async startRequestResolver (file:///var/task/_ssr/ssr.mjs:772:20)
      at async Object.fetch (file:///var/task/_ssr/ssr.mjs:937:10),
  status: 500,
  statusText: undefined,
  headers: undefined,
  data: undefined,
  body: undefined,
  unhandled: true
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the build with Node 24, Nitro nightly@latest, @elastic/elasticsearch ^9.3.1, and Vite 8.0.0-beta.15 in a TanStack Start app. Inspect the generated _libs/@elastic/elasticsearch module around line 16 and the related SSR loading path; done means the built app opens without the reported __extends or __toESM error.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, nodejs, vite
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.