Closed Ali-hd closed 1 month ago
Hi @Ali-hd, have you followed all steps from Cloudflare docs? As far as I see there's not Cloudflare calls in next-config.
If you can work on example a little more and make a npm preview
script that starts the app in the dev mode, it would be a huge help for us. Let's see if the issue persists in dev mode and take from there. Unfortunately, we don't have resources to test clouflare pages from ground up at the moment...
Hi @vklimontovich, the part I didn't add from Cloudflare docs was not needed for my usage.
Our production app uses many packages and everything is working normally. This issue suddenly happened without any change in code, if we rebuild our production it would trigger the issue. We had previously used jitsu with no issues.
This issue doesn't happen locally on a production build when using the same build command, it only happens on Cloudflare.
I deployed it on preview but it's using the same build command as production, when I try to change it the build breaks.
Were you able reproduce the issue with locally? If so, would you mind committing it to your repo?
No, could not reproduce it locally
Ok, then we need to wait for someone to make the issue reproducible. Meanwhile, here's what I suggest:
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Summary
Hi,
I am facing an issue using Jitsu with Next js. I deployed my app to cloudflare pages but the following happens
There is an error returned on any page that uses Jitsu (either
@jitsu/jitsu-react
or@jitsu/js
). The page returnsInternal Server Error
with no other error info.When checking the cloudflare deployment logs, I see two errors messages. This:
Or this
These errors did not help me identify the cause of the issue. I tried running the code on the server side only flags, but the error still occurred.
I also tried using the App Router, it displayed the page, but I can see a server error 500 in the browser network.
Reproduction
Fresh next js Repo deployed to cloudflare pages with jitsu added https://github.com/Ali-hd/jistu-cloudflare-nextjs-bug-reproduce
You can test it in this url
https://jistu-cloudflare-nextjs-bug-reproduce.pages.dev
You can visit the app router page here
https://jistu-cloudflare-nextjs-bug-reproduce.pages.dev/todo
I don't think jitsu host and writekey values matter, you can use empty values
System configuration and versions
next: v14.2.5 @jitsu/jitsu-react: v1.9.8 @cloudflare/next-on-pages: v1.13.2