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

Bun APIs don't work with next #75220

Open
brrock opened this issue Jan 23, 2025 · 3 comments
Open

Bun APIs don't work with next #75220

brrock opened this issue Jan 23, 2025 · 3 comments
Labels
Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@brrock
Copy link

brrock commented Jan 23, 2025

Link to the code that reproduces this issue

https://github.com/brrock/buntestapis/

To Reproduce

Start the app with bun run --bun dev and use the form the api route should fail to compile even though I'm using bun and have bun types installed

Current vs. Expected behavior

I expect this to just use the bun runtime and compile and work simply work but throws this error Error:

 ✓ Compiled /api/s3write in 377ms
 ⨯ ./app/api/s3write/route.ts:2:1
Module not found: Can't resolve 'bun'
  1 | // app/api/s3write/route.ts
> 2 | import { S3Client } from "bun";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3 | import { NextResponse } from 'next/server';
  4 |
  5 | // Initialize S3 client

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: kernel 6.12.9-arch1-1
  Available memory (MB): 15763
  Available CPU cores: 4
Binaries:
  Node: 23.6.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  next: 15.1.6 // Latest available version is detected (15.1.6).
  eslint-config-next: 15.1.6
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

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

Runtime

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

next dev (local)

Additional context

No response

@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Jan 23, 2025
@luudv
Copy link

luudv commented Jan 23, 2025

It seems there are many bugs with the new version. I had to go back to v15.1.5

@brrock2
Copy link

brrock2 commented Jan 23, 2025

It seems there are many bugs with the new version. I had to go back to v15.1.5

it has always been a problem

@brrock
Copy link
Author

brrock commented Jan 23, 2025

It seems there are many bugs with the new version. I had to go back to v15.1.5

@luudv do have example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

3 participants