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

[critical][next.js] withNx plugin required in production dependencies with all its Nx dependencies #16392

Closed
ild0tt0re opened this issue Apr 19, 2023 · 3 comments
Assignees
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug

Comments

@ild0tt0re
Copy link

ild0tt0re commented Apr 19, 2023

Current Behavior

The const withNx = require('@nrwl/next/plugins/with-nx') import in next.config.js file of next.js app, force me to install @nrwl/next modules with all its dependencies also in production.

Run

$ nx build <next-app-name>

If I remove it this happen:
#15794

Expected Behavior

Nx should not force me to install all its dev dependencies only to support the build of Next.js
NOTE:
Since next.config.js is copied as is in production by design, Nx should not add its stuff to avoiding to pollute the node_modules

GitHub Repo

No response

Steps to Reproduce

  1. nx build <next-app-name>
  2. install only production dependencies
  3. run the app in production fail because withNx deps is missing

Nx Report

Node : 18.15.0
   OS   : darwin arm64
   pnpm : 8.1.1

   nx                      : 15.9.2
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/cypress           : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/next              : 15.9.2
   @nrwl/nx-plugin         : 15.9.2
   @nrwl/react             : 15.9.2
   @nrwl/rollup            : 15.9.2
   @nrwl/storybook         : 15.9.2
   @nrwl/tao               : 15.9.2
   @nrwl/web               : 15.9.2
   @nrwl/webpack           : 15.9.2
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @jscutlery/semver : 2.29.3
   ngx-deploy-npm    : 5.2.0
   ---------------------------------------
   Local workspace plugins:
   	 @cloudacademy/nx-plugin

Failure Logs

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Additional Information

No response

@mandarini
Copy link
Member

Possibly related? #15931

@AgentEnder AgentEnder added the scope: nextjs Issues related to NextJS support for Nx label Apr 19, 2023
@jaysoo jaysoo self-assigned this Apr 21, 2023
@jaysoo
Copy link
Member

jaysoo commented Apr 21, 2023

This is a duplicate of #15931

Will close this to keep the discussion there.

@jaysoo jaysoo closed this as completed Apr 21, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug
Projects
None yet
Development

No branches or pull requests

4 participants