Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): install rollup package when generating lib #16373

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

mandarini
Copy link
Member

Current Behavior

The @nrwl/rollup package is not getting installed when generating a buildable react library that uses the @nrwl/rollup:rollup executor, which results in the following error:

npx nx build rollib

 >  NX   Ran target build for project rollib (53ms)

    ✖    0/0 failed
    ✔    0/0 succeeded [0 read from cache]

   View logs and run details at https://nx.app/runs/785BGG9zna

 >  NX   Unable to resolve @nrwl/rollup:rollup.

   Cannot find module '@nrwl/rollup/package.json'
   Require stack:
   - /Users/katerina/Projects/nrwl/test_nx_workspaces/rolls/node_modules/nx/src/utils/package-json.js
   - /Users/katerina/Projects/nrwl/test_nx_workspaces/rolls/node_modules/nx/src/utils/package-manager.js
   - /Users/katerina/Projects/nrwl/test_nx_workspaces/rolls/node_modules/nx/bin/init-local.js
   - /Users/katerina/Projects/nrwl/test_nx_workspaces/rolls/node_modules/nx/bin/nx.js
   Pass --verbose to see the stacktrace.

Expected Behavior

@nrwl/rollup package should get installed.

@vercel
Copy link

vercel bot commented Apr 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Apr 18, 2023 5:31pm

@mandarini mandarini self-assigned this Apr 18, 2023
@@ -30,6 +30,7 @@ export async function addRollupBuildTarget(
host,
{},
{
'@nx/rollup': nxVersion,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The weird thing is that on line 23 of the same file we're doing ensurePackage for the @nx/rollup package, and it still doesn't get installed :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't get added to the workspace, i think it needs to be in the init generator

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to fix this in @nx/rollup:init generator. The bug is that @nx/rollup package is only added when compiler is swc. It should be added for all cases.

@mandarini mandarini enabled auto-merge (squash) April 18, 2023 17:31
@mandarini mandarini merged commit a4ef959 into nrwl:master Apr 18, 2023
peppoasap pushed a commit to peppoasap/nx that referenced this pull request Apr 18, 2023
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants