Skip to content

[BUG] TypeError: Cannot read properties of undefined (reading 'split') #473

Closed
@canuysal

Description

@canuysal

Describe the bug

After following the tutorial steps, I'm receiving this error when visiting any page on the site:

Cannot read properties of undefined (reading 'split')

or sometimes this:

TypeError: Cannot read properties of undefined (reading 'run')

Error is only produced on yarn preview or yarn deploy, no issues with yarn dev.

Any ideas why this might happen, and is there a way to debug this better? Since the code is already compiled I can't track the source of the issue

at 77637 (file:///.../frontend/site/.open-next/server-functions/default/handler.mjs:68682:42) at t (file:///.../frontend/site/.open-next/server-functions/default/handler.mjs:75044:16) at 57083 ...

I tried removing .next and .node-modules.

Steps to reproduce

Visiting the / after yarn dev produces the error codes above.

I'm not sure if you can reproduce it without my repository, but here are some versions:

Next.js version : 14.2.25
opennextjs/cloudflare version: 0.5.12
Yarn version: 1.22.22
Node version: v20.19.0

Expected behavior

No error codes from backend

@opennextjs/cloudflare version

0.5.2

Wrangler version

4.1.0

next info output

(node:266883) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///repository/frontend/site/next.config.js is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /repository/frontend/site/package.json.
(Use `node --trace-warnings ...` to show where the warning was created)
warning ../../package.json: No license field
This project is configured to use yarn because /repository/package.json has a "packageManager" field

Operating System:
  Platform: linux
  Arch: x64
  Version: #18-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb  7 22:34:25 UTC 2025
  Available memory (MB): 23462
  Available CPU cores: 8
Binaries:
  Node: 20.19.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 14.2.25 // An outdated version detected (latest is 15.2.3), upgrade is highly recommended!
  eslint-config-next: 13.5.8
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.8.2
Next.js Config:
  output: N/A
 ⚠ An outdated version detected (latest is 15.2.3), 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
Done in 2.02s.

Additional context

I also used opennext/sst before this repository to deploy on AWS. That may have a conflict?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions