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(nextjs): avoid path error on dev server creation #21998

Conversation

weberjavi
Copy link
Contributor

Current Behavior

When trying to start a dev server on an app by nx start <ap-name> (that under the hood is executing @nx/next:server) it started failing (presumibily after this update). This is the error being displayed 👇🏼

>  NX   The "paths[1]" argument must be of type string. Received undefined


TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
    at validateString (node:internal/validators:162:11)
    at resolve (node:path:1101:7)
    at serveExecutor (/Users/javierabia/Endlessstudio/GFW/frontend/node_modules/@nx/next/src/executors/server/server.impl.js:14:40)
    at serveExecutor.next (<anonymous>)
    at getLastValueFromAsyncIterableIterator (/Users/user/frontend/node_modules/nx/src/utils/async-iterator.js:13:27)
    at iteratorToProcessStatusCode (/Users/userfrontend/node_modules/nx/src/command-line/run/run.js:43:94)
    at /Users/user/frontend/node_modules/nx/src/command-line/run/run.js:169:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleErrors (/Users/user/frontend/node_modules/nx/src/utils/params.js:9:16)
    at async process.<anonymous> (/Users/user/frontend/node_modules/nx/bin/run-executor.js:59:28)

Expected Behavior

This error gets bypassed, since the server does not try to resolve the path in the dev environment.

Related Issue(s)

Fixes #

@weberjavi weberjavi requested a review from a team as a code owner February 26, 2024 16:45
Copy link

vercel bot commented Feb 26, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Mar 4, 2024 5:08pm

@ndcunningham ndcunningham added the scope: nextjs Issues related to NextJS support for Nx label Feb 26, 2024
Copy link
Contributor

@ndcunningham ndcunningham left a comment

Choose a reason for hiding this comment

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

Ahh yes this probably needs to be done as well. Thanks!
Can you:

  1. Update the formatting -> npx nx format
  2. Rebase with the latest version of master

@weberjavi weberjavi force-pushed the fix-nextjs/avoid-path-undefined-error-in-dev-process branch 2 times, most recently from a2606d5 to fdd1c9b Compare February 29, 2024 08:40
@ndcunningham ndcunningham force-pushed the fix-nextjs/avoid-path-undefined-error-in-dev-process branch from fdd1c9b to 824ea8c Compare March 4, 2024 17:04
@ndcunningham ndcunningham self-requested a review March 4, 2024 17:56
@ndcunningham ndcunningham merged commit 1961bb5 into nrwl:master Mar 4, 2024
6 checks passed
FrozenPandaz pushed a commit that referenced this pull request Mar 8, 2024
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 Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: nextjs Issues related to NextJS support for Nx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants