napi-rs / napi-rs/napi-rs

[Bug]: wrong typegen: `TS1030: 'export' modifier already see`

Open
#2,340 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
7.9k
Forks
412
Avg merge
1d 20h
Merged PRs (30d)
61

Description

version

 "@napi-rs/cli": "3.0.0-alpha.64",

error detail

I encountered this problem when upgrading the @napi-rs/cli version of rspack from 3.0.0-alpha.45 to 3.0.0-alpha.64

https://github.com/web-infra-dev/rspack/actions/runs/11607471349/job/32321072375?pr=6429

image

registerGlobalTrace gens two export

image

https://github.com/web-infra-dev/rspack/blob/6c81a4c659d1a01598cd81a9c396def07f47b4e4/crates/node_binding/src/lib.rs#L225

Contributor guide

No contributing guide indexed for this repository

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

Inspect crates/node_binding/src/lib.rs around line 225 and the generated output for registerGlobalTrace. Reproduce the type-generation failure while comparing the @napi-rs/cli versions mentioned in the report; done means the generated declaration no longer contains duplicate export modifiers and the TS1030 error is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.