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

Experimental branch body parsing, Postgres and TRPC errors don't work #205

Open
pellicceama opened this issue Dec 25, 2024 · 3 comments
Open
Labels
bug Something isn't working triage

Comments

@pellicceama
Copy link

Describe the bug

We tried the experimental branch to use middleware and stumbled into significant issues.

TLDR;

  1. Database queries using PostgresJS get stuck with no response (only works with node-pg + patches),
  2. Body parsing in API routes returns 500 errors,
  3. tRPC error responses return HTML 500 pages instead of proper JSON error objects.

Tested with @opennextjs/cloudflare2ab976f and Next.js 14.2.13.

Steps to reproduce

We created a minimal reproduction example with more details here: https://github.com/openintegrations/opennext-cf-sample

Expected behavior

The mentioned issues should work.

@opennextjs/cloudflare version

experimental @opennextjs/cloudflare2ab976f

Wrangler version

3.95.0

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Fri Jul  5 17:55:37 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11
Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: N/A
  pnpm: 9.13.2
Relevant Packages:
  next: 14.2.13 // An outdated version detected (latest is 15.1.2), upgrade is highly recommended!
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.7.2
Next.js Config:
  output: N/A
 ⚠ An outdated version detected (latest is 15.1.2), upgrade is highly recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

No response

@pellicceama pellicceama added bug Something isn't working triage labels Dec 25, 2024
@pellicceama
Copy link
Author

pellicceama commented Dec 25, 2024

@vicb FYI we managed to make it work regardless on our fairly complex next app https://github.com/openintegrations/openint/tree/cf-new

We are part of the Cloudflare Worker launchpad accelerator, our previous name was Evefan. Feel free to ping me on the discord or over email if we can be helpful :)

@vicb
Copy link
Contributor

vicb commented Dec 26, 2024

We tried the experimental branch to use middleware and stumbled into significant issues.

The experimental branch has been merged back to main and release as 0.3.x.
Docs are up to date at opennext.js.org/cloudflare

FYI we managed to make it work regardless on our fairly complex next app https://github.com/openintegrations/openint/tree/cf-new

What works/does not work in the end?
Do you still need help with anything?
Sorry I'm a little confused about the status here

@pellicceama
Copy link
Author

The experimental branch has been merged back to main and release as 0.3.x.
Ahh great to hear! Just upgraded our minimal example to it and that seems to fix the body parsing issue.

What works/does not work in the end?

We're OK, no immediate ask for help just thought I'd report these issues as we had to do a number of monkey patches to make our app work.

The main thing to call your attention to right now is the issue with PostgresJS, which I know is a key dependency for CF. I've also reported an issue to node-pg.

I also upgraded our cf-new main app branch to 0.3.2 and now see that Clerk middleware that used to work now isn't working. Need to investigate further though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants