vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.2k stars 26.76k forks source link

Dev server doesn't pickup new changes when fixing jsx syntax error on the edge runtime #58427

Open alarbada opened 10 months ago

alarbada commented 10 months ago

Link to the code that reproduces this issue

https://github.com/alarbada/reproduction-app

To Reproduce

  1. Start the application (in my case, bun run dev, but I've also checked this error with pnpm / npm).
  2. You'll see the following html on screen:
    <div>
      <h1>hi</h1>
    </div>
  1. Change the jsx expression so that it causes a syntax error and save the file
/** Add your relevant code here for the issue to reproduce */
export default function Home() {
  return (
    <div>
      h1>hi</h1>         // <-- error!
    </div>
  )
}
  1. Try fix the jsx error without restarting the dev server. I haven't been able to do so.

Considerations: On page.tsx I'm using export const runtime = 'edge'. If you comment this line, the dev server works as expected.

Current vs. Expected behavior

I'd expect the dev server to pickup the jsx fix.

Verify canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #8 SMP PREEMPT_DYNAMIC Mon Nov  6 14:48:30 UTC 2023
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.8.0
Relevant Packages:
  next: 14.0.3-canary.7
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

App Router

Additional context

I've tested against next 13.5.4, next 14.0.0 / 14.0.2 and canary. All of them have the same error.

nil1511 commented 9 months ago

Facing the same issue in 14.0.4