oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.06k stars 2.76k forks source link

Next-auth and/or form not working #6497

Open confact opened 1 year ago

confact commented 1 year ago

What version of Bun is running?

1.0.6

What platform is your computer?

Linux 5.15.77-amd64-desktop x86_64 unknown

What steps can reproduce the bug?

I have next-auth in a react function, with this return:

      <form method="post" action="/api/auth/callback/credentials">
        <input name="csrfToken" type="hidden" value={csrfToken} />
        <Input discreet name="email" type="email" label="Email" placeholder="Email" />
        <Input discreet name="password" type="password" label="Password" placeholder="Password" />
        <button
        type="submit"
        >
          Sign in
        </button>
      </form>

When running bun run -b dev the sign-in button just refresh the page with nothing happens. When running normal next dev with node.js, it works as expected, and login and redirect.

What is the expected behavior?

It should login and redirect me to a different page

What do you see instead?

Same page, it refresh and reset the page.

Additional information

I do use next-auth and next-safe:

next-auth@~>4:
  version "4.23.1"
  resolved "https://registry.npmjs.org/next-auth/-/next-auth-4.23.1.tgz"
  integrity sha512-mL083z8KgRtlrIV6CDca2H1kduWJuK/3pTS0Fe2og15KOm4v2kkLGdSDfc2g+019aEBrJUT0pPW2Xx42ImN1WA==
  dependencies:
    "@babel/runtime" "^7.20.13"
    "@panva/hkdf" "^1.0.2"
    cookie "^0.5.0"
    jose "^4.11.4"
    oauth "^0.9.15"
    openid-client "^5.4.0"
    preact "^10.6.3"
    preact-render-to-string "^5.1.19"
    uuid "^8.3.2"

next-safe@~>3:
  version "3.4.1"
  resolved "https://registry.npmjs.org/next-safe/-/next-safe-3.4.1.tgz"
  integrity sha512-GOam3DYMHUIKwxHeqVg9pkuYFhvtUeivHexdbL3lg0mjibsnIB3NOD81dKDgaeX+cReWbugdCtWYllzXmmpE+Q==
matheuslemke commented 10 months ago

+1 up... I'm facing the same problem... Found this issue reply in next-auth repo.

github-actions[bot] commented 2 months ago

This issue is stale and may be closed due to inactivity. If you're still running into this, please leave a comment.