nrwl / nx

Smart Monorepos ยท Fast CI
https://nx.dev
MIT License
23.58k stars 2.36k forks source link

web:rollup executor doesn't produce declarations with compiler set to swc #9059

Closed j3ski closed 1 year ago

j3ski commented 2 years ago

Current Behavior

When running nx build for my buildable library I don't get d.ts files in the output directory.

Expected Behavior

d.ts files should be generated.

Steps to Reproduce

  1. Generate a buildable library with --compiler swc
  2. Build it

Environment

Node : 16.10.0
   OS   : darwin arm64
   yarn : 1.22.17

   nx : 13.8.3
   @nrwl/angular : undefined
   @nrwl/cli : 13.8.3
   @nrwl/cypress : 13.8.3
   @nrwl/detox : undefined
   @nrwl/devkit : 13.8.3
   @nrwl/eslint-plugin-nx : 13.8.3
   @nrwl/express : undefined
   @nrwl/jest : 13.8.3
   @nrwl/js : 13.8.3
   @nrwl/linter : 13.8.3
   @nrwl/nest : undefined
   @nrwl/next : undefined
   @nrwl/node : undefined
   @nrwl/nx-cloud : undefined
   @nrwl/react : 13.8.3
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.8.3
   @nrwl/tao : 13.8.3
   @nrwl/web : 13.8.3
   @nrwl/workspace : 13.8.3
   typescript : 4.4.4
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
FrozenPandaz commented 2 years ago

I see this resolved in the latest Nx. Can you please retry with the latest version?

In fact, I also see it resolved in 13.8.3. :thinking:

If you do not see this resolved, can you please provide a repo so we can reproduce the issue?

j3ski commented 2 years ago

Hi @FrozenPandaz No, this is not resolved in the latest Nx. I am able to reproduce it with 13.8.8. Here is a repo: https://github.com/j3ski/nx-react-swc

owen26 commented 2 years ago

I'm having the same issue too. And from what I can see in the swc thread

https://github.com/swc-project/swc/issues/657

It seems like a missing feature so I thought the missed types in NX are expected.

Not a big issue for compiling and bundling apps, but for libs that mean to be published to NPM, this is an essential feature.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

j3ski commented 2 years ago

Ping. Still relevant.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

nezdemkovski commented 2 years ago

Still relevant

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

sergiocarneiro commented 2 years ago

This issue still exists

sahil-shubham commented 2 years ago

Still relevant. Had to change compiler to babel in project.json to fix it.

kjrocker commented 2 years ago

I also ran into this issue. Having to switch back to babel and lose my SWC performance improvements

tobysmith568 commented 2 years ago

@FrozenPandaz would you consider removing the blocked tag that you added to this? This issue is still present in the latest version

jeffgaynor commented 2 years ago

Same experience here with swc vs babel.

tobysmith568 commented 2 years ago

Thanks for re-opening, @FrozenPandaz. What needs to be done to remove the blocked tag? Other people above have posted repros

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

nezdemkovski commented 2 years ago

Still relevant.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

tobysmith568 commented 1 year ago

Still relevant.

romhayh commented 1 year ago

Still relevant

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

tobysmith568 commented 1 year ago

Still relevant.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

mhabegger commented 1 year ago

Does anyone know what and where something needs to be addressed? Is it a swc issue?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

nezdemkovski commented 1 year ago

Still relevant

mderkach commented 1 year ago

Still relevant

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

tobysmith568 commented 1 year ago

Still relevant

Chanki-Min commented 1 year ago

because of this line, when we use swc, tsc is not running, so no d.t.s files

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

miguelmoreba commented 1 year ago

This is still relevant

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

HashemKhalifa commented 1 year ago

This is still relevant

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

hishamhaniffa commented 1 year ago

This is still relevant

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

romhayh commented 1 year ago

Still relevant

DreadfulBot commented 1 year ago
ShayDavidson commented 1 year ago

still relevant

ShayDavidson commented 1 year ago

Based on the comment by @Chanki-Min, I've created a custom version of the rollup executor that includes the missing useSwc check:

Just add these 4 files into a folder in your mono-repo, e.g. ./executors/rollup: https://gist.github.com/ShayDavidson/e89751a5bc57a17ca6846dfd68aabf45

And then in the project.json, reference it like this:

"build": {
      "executor": "./executors/rollup:rollup",
     ...
}

It does generate the type declarations, but I'm not sure if there are other bad side-effects of this (will update this comment if I find any).

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

DreadfulBot commented 1 year ago

active

noneall commented 1 year ago

this is still relevant

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

pawanrana1992 commented 1 year ago

How it can be close, it is still relevant. without giving and reply and resulations, this thread closed multiple times. Dear team please provide the valid fix for this. bcs of this issue, me and my team are not able to directly use the nx, and in this case need to use babel instead of swc with webpack instead of NX !!!!

Chanki-Min commented 1 year ago

Seems like nx contributers has busy days. I'm gonna make PR for this (in weekends?)

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

YonatanKra commented 1 year ago

Can this be solved? It still happens in the latest 15.x and 16.x

Chanki-Min commented 1 year ago

this issue fixed by https://github.com/nrwl/nx/pull/18342

cc @YonatanKra

Chanki-Min commented 1 year ago

Can we close this issue @jaysoo ?

Seems like this closed by #18342