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

[🐛 Bug]: Internal Server Error when using Jitsu #862

Open
1 task
Ali-hd opened this issue Aug 19, 2024 · 0 comments
Open
1 task

[🐛 Bug]: Internal Server Error when using Jitsu #862

Ali-hd opened this issue Aug 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Ali-hd
Copy link

Ali-hd commented Aug 19, 2024

next-on-pages environment related information

Build is successful

Description

There is an error returned on any page that uses Jitsu (either @jitsu/jitsu-react or @jitsu/js). The page returns Internal Server Error with no other error info.

When checking the cloudflare deployment logs, I see two errors messages.
This:

  "truncated": false,
  "outcome": "ok",
  "scriptName": "pages-worker--3536470-production",
  "diagnosticsChannelEvents": [],
  "exceptions": [],
  "logs": [
    {
      "message": [
        "Error: An error occurred while evaluating the target edge function (__next-on-pages-dist__/functions/index.func.js)"
      ],
      "level": "error",
      "timestamp": 1724090044141
    }
  ],
  "eventTimestamp": 1724090044139,
  "event": {
    "request": {
      "url": "https://jistu-cloudflare-nextjs-bug-reproduce.pages.dev/",
      "method": "GET",
      "headers": {
        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
        "accept-encoding": "gzip, br",
        "accept-language": "en-US,en;q=0.9,ar;q=0.8",
        "cache-control": "max-age=0",

Or this

{
  "truncated": false,
  "outcome": "ok",
  "scriptName": "pages-worker--3536470-production",
  "diagnosticsChannelEvents": [],
  "exceptions": [],
  "logs": [
    {
      "message": [
        "TypeError: Cannot read properties of undefined (reading '__global__')"
      ],
      "level": "error",
      "timestamp": 1724090106484
    }
  ],
  "eventTimestamp": 1724090106408,
  "event": {
    "request": {
      "url": "https://jistu-cloudflare-nextjs-bug-reproduce.pages.dev/",
      "method": "GET",
      "headers": {
        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
        "accept-encoding": "gzip, br",
        "accept-language": "en-US,en;q=0.9,ar;q=0.8",
        "cache-control": "max-age=0",

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

Pages Deployment Method

None

Pages Deployment ID

No response

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@Ali-hd Ali-hd added the bug Something isn't working label Aug 19, 2024
@Ali-hd Ali-hd changed the title [🐛 Bug]: Internal Server Error when using Jitsu with getServerSideProps [🐛 Bug]: Internal Server Error when using Jitsu Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant