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

.next dir still in old outputPath when overriding using --outputPath cli flag on next.js build #17881

Closed
1 of 4 tasks
dotrakoun-clearstreet opened this issue Jun 30, 2023 · 1 comment · Fixed by #17947
Closed
1 of 4 tasks
Assignees
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug

Comments

@dotrakoun-clearstreet
Copy link

dotrakoun-clearstreet commented Jun 30, 2023

Current Behavior

have next generated project with project.json

"targets": {
                "build": {
                        "executor": "@nx/next:build",
                        "outputs": ["{options.outputPath}"],
                        "options": {
                                "outputPath": "dist"
                        },
...

run

nx build nextjsproj -c production --outputPath=dist/sub

and you get dist/sub/* files
but no .next/ dir
the .next/ dir is generated in dist/.next

Expected Behavior

dist/sub/*
dist/sub/.next

.next should be colocated with rest of output so you can run npm run start from the dist/sub directory

GitHub Repo

No response

Steps to Reproduce

  1. next nextjs project with above project.json config
  2. build it with a outputPath path cli flag override

Nx Report

>  NX  Falling back to ts-node for local typescript execution. This may be a little slower.
  - To fix this, ensure @swc-node/register and @swc/core have been installed

 >  NX   Report complete - copy this into the issue template

   Node   : 18.16.0
   OS     : linux-x64
   pnpm   : 8.5.0

   nx                 : 16.4.0
   @nx/js             : 16.4.0
   @nx/jest           : 16.4.0
   @nx/linter         : 16.4.0
   @nx/workspace      : 16.4.0
   @nx/cypress        : 16.4.0
   @nx/devkit         : 16.4.0
   @nx/esbuild        : 16.4.0
   @nx/eslint-plugin  : 16.4.0
   @nx/next           : 16.4.0
   @nx/node           : 16.4.0
   @nx/react          : 16.4.0
   @nx/rollup         : 16.4.0
   @nx/storybook      : 16.4.0
   @nrwl/tao          : 16.4.0
   @nx/web            : 16.4.0
   @nx/webpack        : 16.4.0
   typescript         : 4.9.5
   ---------------------------------------
   Community plugins:
   @trumbitta/nx-plugin-unused-deps : 1.12.1
   ---------------------------------------

Failure Logs

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@ndcunningham ndcunningham self-assigned this Jun 30, 2023
@FrozenPandaz FrozenPandaz added the scope: nextjs Issues related to NextJS support for Nx label Jun 30, 2023
ndcunningham added a commit to ndcunningham/nx that referenced this issue Jul 4, 2023
@github-actions
Copy link

github-actions bot commented Aug 4, 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 Aug 4, 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

Successfully merging a pull request may close this issue.

3 participants