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 dev CLI does not tell config errors before automatically stopping #54319

Closed
1 task done
busybox11 opened this issue Aug 21, 2023 · 2 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@busybox11
Copy link

busybox11 commented Aug 21, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

❯ npx next info

    Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Fri, 11 Aug 2023 11:03:36 +0000
    Binaries:
      Node: 20.5.0
      npm: 9.8.1
      Yarn: 1.22.19
      pnpm: 8.5.1
    Relevant Packages:
      next: 13.4.20-canary.0
      eslint-config-next: 13.4.19
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/nifty-nova-46w2sz?file=%2Fnext.config.js%3A18%2C4

To Reproduce

First, run the dev server with next dev. Everything should work fine.

Then try to append an invalid async headers() function to your next.config.js, and let the dev server reload itself (see pic attached).

Mine was the following :

async headers() {
  return [
    {
      source: '/_next/static/media/*',
      headers: [
        {
          key: 'Cache-Control',
          value: 'public, max-age=31536000, immutable',
        },
      ],
    }
  ]
}

Describe the Bug

While reloading itself, the dev server doesn't tell about the config error and just crashes without logging anything, nor an error code (see green arrow on the beginning of the line following the last log - that means it exited with code 0).

image

nextjs_headers_dev_cli.mp4

Expected Behavior

The error should at least be mentionned, and perhaps the server should exit with a code other than 0.

(This behavior could also be used for the next next dev that will log the error before stopping, an error code would be a good thing here too).

Which browser are you using? (if relevant)

/

How are you deploying your application? (if relevant)

/

@busybox11 busybox11 added the bug Issue was opened via the bug report template. label Aug 21, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 19, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants