message-parser-napi: yarn build writes a binary index.js can't load, and turbo doesn't cache it

Aperta
#44,085 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@SayantanSheet ci sta già lavorando.

Dal 2/12/2026.

  • #44086 di @SayantanSheet — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
node.js, typescript

Direzione di ricerca

Read packages/message-parser-napi/package.json, index.js, and the root turbo.json; the issue also proposes adding packages/message-parser-napi/turbo.json. Start by checking the build script and Turbo output configuration against the reported build. Done means the generated binary can be loaded by the package and a Turbo cache hit restores the binary; pull request #44086 is already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: bug

@rocket.chat/message-parser-napi (added in #44003) has two build problems. I reproduced both on develop (55905bd) with Turbo 2.11.7 and @napi-rs/cli 2.18.4.

1. The built binary has the wrong name. The build script runs napi build --release, which writes message-parser-napi.node. The checked-in index.js only loads message-parser-napi.<platform>.node (e.g. message-parser-napi.linux-x64-gnu.node) or the per-platform npm package, so right after yarn build:

$ node -e "require('./packages/message-parser-napi')"
Error: Cannot find module '@rocket.chat/message-parser-napi-linux-x64-gnu'

tests/compare.cjs (the package's yarn test) also requires ../index.

2. Turbo doesn't cache the output. The root turbo.json declares dist/** as build output, but this package writes *.node and index.d.ts next to its package.json. Every build prints:

WARNING  no output files found for task @rocket.chat/message-parser-napi#build. Please check your `outputs` key in `turbo.json`

and a cache hit (local or CI's turbo cache) restores no binary.

Proposed fix (tested):

  1. package.json: "build": "napi build --platform --release"
  2. Add packages/message-parser-napi/turbo.json:
{ "extends": ["//"], "tasks": { "build": { "outputs": ["*.node", "index.d.ts"] } } }

With both, the build writes message-parser-napi.linux-x64-gnu.node, require works, index.js is unchanged, the warning is gone, and a cache hit restores the binary. Nothing imports the package yet, so this is latent today.

I'm happy to open a PR.

Lingua principale
TypeScript
Stelle
46.6k
Fork
14.2k
Merge medio
2g 21h
PR unite (30g)
302

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/Rocket.Chat

Tutte le issue di RocketChat/Rocket.Chat

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.