next-on-pages: [πŸ› Bug]: Nextjs v13.3.1 fresh install worker threw exception

Cli version

0.10.0

next-on-pages environment related information

System:
        Platform: darwin
        Arch: arm64
        Version: Darwin Kernel Version 22.4.0: Mon Mar  6 21:01:02 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8112
        CPU: (8) arm64 Apple M2
        Memory: 24 GB
        Shell: /bin/zsh
Binaries:
        Node: 18.12.1
        Yarn: N/A
        npm: 9.6.5
        pnpm: N/A
Package Manager Used: npm
Relevant Packages:
        @cloudflare/next-on-pages: 0.10.0
        vercel: N/A
        next: 13.3.1

Description

I see that issue #186 is already merged but I’m having this exception thrown in prod

Error 1101 Worker threw exception

{
  "outcome": "exception",
  "scriptName": "pages-worker--1029254-production",
  "exceptions": [
    {
      "name": "Error",
      "message": "Dynamic require of \"node:buffer\" is not supported",
      "timestamp": 1682397982459
    }
  ],
  "logs": [],
  "eventTimestamp": 1682397982459,
  "event": {
    "request": {
      "url": "https://08541378.mech.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",
        "accept-encoding": "gzip",
        "accept-language": "en-US,en;q=0.8",
        "cache-control": "max-age=0",
        "cf-connecting-ip": "107.199.200.137",
        "cf-ipcountry": "US",
        "cf-ray": "7bd3f11e5f0ecfa8",
        "cf-visitor": "{\"scheme\":\"https\"}",
        "connection": "Keep-Alive",
        "dnt": "1",
        "host": "08541378.mech.pages.dev",
        "priority": "u=0, i",
        "sec-ch-ua": "\"Chromium\";v=\"112\", \"Brave\";v=\"112\", \"Not:A-Brand\";v=\"99\"",
        "sec-ch-ua-mobile": "?0",
        "sec-ch-ua-platform": "\"macOS\"",
        "sec-fetch-dest": "document",
        "sec-fetch-mode": "navigate",
        "sec-fetch-site": "cross-site",
        "sec-fetch-user": "?1",
        "sec-gpc": "1",
        "upgrade-insecure-requests": "1",
        "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
        "x-forwarded-proto": "https",
        "x-real-ip": "107.199.200.137"
      },
      "cf": {
        "longitude": "-122.44140",
        "httpProtocol": "HTTP/3",
        "tlsCipher": "AEAD-AES128-GCM-SHA256",
        "continent": "NA",
        "asn": 7018,
        "clientAcceptEncoding": "gzip, deflate, br",
        "country": "US",
        "tlsClientAuth": {
          "certIssuerDNLegacy": "",
          "certIssuerSKI": "",
          "certSubjectDNRFC2253": "",
          "certSubjectDNLegacy": "",
          "certFingerprintSHA256": "",
          "certNotBefore": "",
          "certSKI": "",
          "certSerial": "",
          "certIssuerDN": "",
          "certVerified": "NONE",
          "certNotAfter": "",
          "certSubjectDN": "",
          "certPresented": "0",
          "certRevoked": "0",
          "certIssuerSerial": "",
          "certIssuerDNRFC2253": "",
          "certFingerprintSHA1": ""
        },
        "tlsExportedAuthenticator": {
          "clientFinished": "1c842cd235a3841d8f6dd4cb2107d630e7c3108f02fc5ac605c9c8d63e65423f",
          "clientHandshake": "24369ebd3f59f1545d30a3792a777dbe6a413036a8f46ba788e3433701812f6b",
          "serverHandshake": "87c529c4b1e801ae4aa0f8c1d636b89a87bfcbea3bf8ae565796207ec10cdd99",
          "serverFinished": "0606d67688e1b65fc915da89032f059eb3c900346437908e25b3f10de8f2a8a8"
        },
        "tlsVersion": "TLSv1.3",
        "city": "San Francisco",
        "timezone": "America/Los_Angeles",
        "requestPriority": "",
        "edgeRequestKeepAliveStatus": 1,
        "postalCode": "94112",
        "colo": "SJC",
        "latitude": "37.72010",
        "region": "California",
        "regionCode": "CA",
        "asOrganization": "AT&T Internet",
        "metroCode": "807",
        "pagesHostName": "08541378.mech.pages.dev"
      }
    },
    "response": {
      "status": 500
    }
  },
  "id": 8
}

Reproduction

https://github.com/hjaber/mech

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

It works ! you rocks πŸ˜ƒ

@atali ah ok πŸ™‚, I just checked and tested it out and the CI build image has been updated and the automatic deployment works fine now πŸ™‚πŸ‘

@hjaber sorry it’s taking a while, we’re working on it πŸ˜“

Not ideal but until my PR gets merged you can just use the prerelease (https://github.com/cloudflare/workers-sdk/pull/3133#issuecomment-1533440046) to manually deploy your app (making sure that you’ve got nodejs_compat set in the dashboard)

I can confirm that I’m able to run locally, and on CF Pages with the follow deps versions:

    "@cloudflare/next-on-pages": "0.10.1",
    "next": "13.4.2",
    "vercel": "29.3.0",
    "wrangler": "2.20.0"

I know this issue is titled NextJS v13.3.1, but it was created when that was the latest, now NextJS is up to v13.4.2

@hjaber if you want you can check the beta release: https://www.npmjs.com/package/@cloudflare/next-on-pages/v/0.0.0-9f5b83c should be all good now πŸ™‚ (and I’ll probably do a proper release later today or tomorrow)