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

@nrwl/next needed as dependency rather than devDependency #16575

Closed
ckaeslin opened this issue Apr 26, 2023 · 4 comments
Closed

@nrwl/next needed as dependency rather than devDependency #16575

ckaeslin opened this issue Apr 26, 2023 · 4 comments

Comments

@ckaeslin
Copy link
Contributor

Current Behavior

Probably a regression of #12150

@nrwl/next in package.json dependency leads to errors when running in production with npm install --omit=dev --prefer-offline --no-audit --ignore-scripts

Expected Behavior

@nrwl/next can be put into devDependencies and the app runs

GitHub Repo

No response

Steps to Reproduce

  1. Create a simple new nx next app.
  2. Dockerize it with the following docker file.
FROM node:18-alpine
ENV NODE_ENV=production
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm install --omit=dev  --prefer-offline --no-audit --ignore-scripts

Nx Report

Node : 18.16.0
OS   : darwin arm64
npm  : 9.6.5

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/nest              : 15.9.2
@nrwl/next              : 15.9.2
@nrwl/node              : 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              : 5.0.4
---------------------------------------
Community plugins:
@nx-extend/strapi : 3.5.1
@nxkit/playwright : 2.2.0
---------------------------------------
Local workspace plugins:

Failure Logs

error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Cannot find module '@nrwl/next/plugins/with-nx'
Require stack:
- /app/next.config.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at mod._resolveFilename (/app/node_modules/next/dist/build/webpack/require-hook.js:23:32)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/app/next.config.js:2:16)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/next.config.js' ]
}

Additional Information

No response

@ckaeslin ckaeslin changed the title @nrwl/next need as dependency rather than devDependency @nrwl/next needed as dependency rather than devDependency Apr 26, 2023
@ckaeslin
Copy link
Contributor Author

just saw it will probably be fixed by #16469

@AgentEnder
Copy link
Member

Yup, this is already fixed by #16469

@wingy3181
Copy link

Is this fix only available in 16?

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

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 Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants