tursodatabase / tursodatabase/libsql-client-ts

Cloudflare worker error with opennextjs-cloudflare

Open
#303 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
576
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm hoping somebody could shed light on this error I'm getting when trying to deploy a Next.js app on Cloudflare

Image
✘ [ERROR] ⨯ Error: Neon: unsupported Linux architecture:

      at currentTarget
  (.open-next/server-functions/default/handler.mjs:98994:15)
      at requireNative
  (.open-next/server-functions/default/handler.mjs:99303:20)
      at .open-next/server-functions/default/node_modules/libsql/index.js
  (.open-next/server-functions/default/handler.mjs:99338:9)
      at require_libsql
  (.open-next/server-functions/default/handler.mjs:55:49)
      at .open-next/server-functions/default/node_modules/@libsql/client/lib-esm/sqlite3.js
  (.open-next/server-functions/default/handler.mjs:99842:29)
      at init_sqlite3
  (.open-next/server-functions/default/handler.mjs:52:54)
      at .open-next/server-functions/default/node_modules/@libsql/client/lib-esm/node.js
  (.open-next/server-functions/default/handler.mjs:108213:5)
      at init_node3
  (.open-next/server-functions/default/handler.mjs:52:54)
      at null.<anonymous>
  (.open-next/server-functions/default/handler.mjs:108233:52)

[wrangler:inf] GET /api/client/xxx 500 Internal Server Error (55ms)

I also get Error: Neon: unsupported macOS architecture

Here's the repo https://github.com/Escuela-dev/tracking

npm run preview
$ npm run build:worker && wrangler dev
$ opennextjs-cloudflare

┌─────────────────────────────┐
│ OpenNext — Cloudflare build │
└─────────────────────────────┘

App directory: /Users/gianpaj/github/escuela-dev/toggl-tracking-escuela
Next.js version : 14.2.24
@opennextjs/cloudflare version: 0.5.12
@opennextjs/aws version: https://pkg.pr.new/@opennextjs/aws@7e23eee

┌─────────────────────────────────┐
│ OpenNext — Building Next.js app │
└─────────────────────────────────┘

I followed these repos as examples:

Thanks a lot!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the deployment with npm run preview, which runs npm run build:worker and wrangler dev. Inspect the generated .open-next/server-functions/default/handler.mjs stack and the @libsql/client/lib-esm/sqlite3.js entry point. Done means identifying the cause of the unsupported Linux and macOS architecture errors and confirming that the worker request no longer returns 500.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, sqlite, typescript
Domain
backend, cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.