vercel / next.js

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

Using "jsonpath" package in a route handler causes the route to respond with not found #61507

Open drorIvry opened 8 months ago

drorIvry commented 8 months ago

Link to the code that reproduces this issue

https://github.com/drorIvry/jsonpath-bug

To Reproduce

  1. start app in development
  2. run in terminal curl http://localhost:3000/api/test
  3. you'll get the NotFound page
  4. if you un-comment the export const runtime = 'edge' OR if you remove the jsonpath code and run again you'll get {"success": true}

Current vs. Expected behavior

current: getting the NotFoundPage expected: the route handler will run correctly

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
    Binaries:
      Node: 20.9.0
      npm: 9.8.1
      Yarn: 1.22.19
      pnpm: 8.10.2
    Relevant packages:
      next: 13.0.8-canary.0
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0

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

App Router

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

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

No response

charlypoly commented 1 month ago

Can confirm!