nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.23k stars 2.31k forks source link

Using the library generated by @monodon/rust napi in the same project #26481

Open cskiwi opened 3 months ago

cskiwi commented 3 months ago

Current Behavior

Currently I get a error TS2307: Cannot find module error when building. The IDE does understand the types and such

Expected Behavior

That it would use the generated library

GitHub Repo

https://github.com/cskiwi/nestjs-rust

Steps to Reproduce

  1. Create a library using Nestjs
  2. Create a library using @monodon/rust
  3. Import the rust library in your nestjs service

Nx Report

Node   : 20.14.0
OS     : win32-x64
npm    : 10.7.0

nx                 : 19.2.2
@nx/js             : 19.2.2
@nx/jest           : 19.2.2
@nx/linter         : 19.2.2
@nx/eslint         : 19.2.2
@nx/workspace      : 19.2.2
@nx/angular        : 19.2.2
@nx/devkit         : 19.2.2
@nx/eslint-plugin  : 19.2.2
@nx/nest           : 19.2.2
@nx/node           : 19.2.2
@nx/playwright     : 19.2.2
@nrwl/tao          : 19.2.2
@nx/web            : 19.2.2
@nx/webpack        : 19.2.2
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/playwright/plugin
@nx/eslint/plugin
@nx/webpack/plugin
@monodon/rust
---------------------------------------
Community plugins:
@monodon/rust : 1.4.0
ngxtension    : 3.4.0

Failure Logs

╰─ nx build backend-test

   √  1/1 dependent project tasks succeeded [0 read from cache]

   Hint: you can run the command with --verbose to see the full dependent project outputs

—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 

> nx run backend-test:build

Compiling TypeScript files for project "backend-test"...
libs/backend/test/src/lib/backend-test.service.ts:2:21 - error TS2307: Cannot find module '@app/rust-testing' or its corresponding type declarations.

2 import { sum } from '@app/rust-testing';
                      ~~~~~~~~~~~~~~~~~~~

—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 

 NX   Ran target build for project backend-test and 1 task(s) they depend on (7s)

   ×  1/2 failed
   √  1/2 succeeded [0 read from cache]

View structured, searchable error logs at https://nx.app/runs/IaWxXEbJ1s

Package Manager Version

No response

Operating System

Additional Information

No response

FrozenPandaz commented 3 months ago

@Cammisuli I think this issue belongs in the monodon repo. What do you think?

Cammisuli commented 3 months ago

Yea, it's because outputs aren't added to Napi builds by default. I need to fix it there.

cskiwi commented 2 months ago

@Cammisuli any idea when you could fix it (ballpark is fine)? just so I don't have to check the package every day :P