Skip to content

Error: "process is undefined" when using Cloudflare with Sveltekit (9.2.0) #15506

Description

@tarekfb

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/sveltekit

SDK Version

9.2.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

export const handle: Handle = sequence(initCloudflareSentryHandle({
  dsn: "my-actual-dsn-here",
  tracesSampleRate: 1.0,
}), sentryHandle(), supabase, authGuard);

Steps to Reproduce

Follow instructions in new docs, and instructions in the pr for cloudflare & sveltekit support

Publish to cloudflare.
Error is printed to console, viewed in Cloudflare Real-time Logs under Functions for the build.

Expected Result

No error occurs.

Actual Result

Error occurs. I am not using environment anywhere in the sentry setup, so I'm not sure why this issue is occuring.

Logs:

{
  "truncated": false,
  "executionModel": "stateless",
  "outcome": "ok",
  "scriptVersion": {
    "id":redacted
  },
  "scriptName": "pages-worker--redacted-preview",
  "diagnosticsChannelEvents": [],
  "exceptions": [],
  "logs": [
    {
      "message": [
        {
         redacted
        }
      ],
      "level": "log",
      "timestamp": 1740572330174
    },
    {
      "message": [
        "ReferenceError: process is not defined"
      ],
      "level": "error",
      "timestamp": 1740572330174
    },
    {
      "message": [
        "ReferenceError: process is not defined"
      ],
      "level": "error",
      "timestamp": 1740572330174
    }
  ],
  "eventTimestamp": redacted
  "event": {
    "request": {
      "url": "https://redacted.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,en-US;q=0.9,sv-SE;q=0.8,sv;q=0.7,zh-CN;q=0.6,zh;q=0.5,la;q=0.4",
        "cache-control": "max-age=0",
        "cf-connecting-ip": redacted
        "cf-ipcountry"redacted
        "cf-ray": redacted,
        "cf-visitor": "{\"scheme\":\"https\"}",
        "connection": "Keep-Alive",
        "host": "redacted.pages.dev",
        "priority": "u=0, i",
        "referer": "/",
        "sec-ch-ua": "\"Not(A:Brand\";v=\"99\", \"Google Chrome\";v=\"133\", \"Chromium\";v=\"133\"",
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": "\"Windows\"",
        "sec-fetch-dest": "document",
        "sec-fetch-mode": "navigate",
        "sec-fetch-site": "cross-site",
        "sec-fetch-user": "?1",
        "upgrade-insecure-requests": "1",
        "user-agent":redacted
        "x-forwarded-proto": "https",
        "x-real-ip": redacted
      },
      "cf": {
        "requestHeaderNames": {},
        "httpProtocol": "HTTP/3",
        "tlsCipher": "AEAD-AES128-GCM-SHA256",
        "continent": "EU",
        "asn": 2119,
        "clientAcceptEncoding": "gzip, deflate, br, zstd",
        "country":redacted
        "isEUCountry": "1",
        "verifiedBotCategory": "",
        "requestPriority": "",
        "tlsClientAuth": redacted
         tSHA1": ""
        },
        "tlsClientExtensionsSha1": "redacted
        "tlsExportedAuthenticator":redacted,
        "tlsVersion": "TLSv1.3",
        "colo": "redacted
        "timezone": "redacted
        "region": redacted
        "longitude":redacted,
        "edgeRequestKeepAliveStatus": 1,
        "tlsClientRandom": redacted,
        "latitude": redacted",
        "postalCode": "redacted,
        "city": "Solna",
        "regionCode": redacted,
        "asOrganization": redacted,
        "tlsClientHelloLength": "1761",
        "pagesHostName": redacted,
        "botManagement": {
          "corporateProxy": false,
          "verifiedBot": false,
          "jsDetection": {
            "passed": false
          },
          "staticResource": false,
          "detectionIds": {},
          "score": 99
        }
      }
    },
    "response": {
      "status": 500
    }
  },
  "id": 0
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions