fresh icon indicating copy to clipboard operation
fresh copied to clipboard

Cannot use libsql in production

Open DontMash opened this issue 1 month ago • 0 comments

I started a small project to experiment with fresh and certain packages I tend to use. This also includes drizzle and using libsql as a database driver. When using the vite dev-server (deno task dev) everything is fine. After running deno task build and starting the project (deno task start), I received this error:

Task start deno serve -A _fresh/server.js
error: Uncaught (in promise) Error: Cannot find module '@libsql/darwin-arm64'
Require stack:
- <path>/fresh-libsql/_fresh/server/server-entry.mjs
    at Module._resolveFilename (node:module:633:15)
    at Module._load (node:module:496:27)
    at Module.require (node:module:694:19)
    at require (node:module:828:16)
    at requireNative (file:///<path>/fresh-libsql/_fresh/server/server-entry.mjs:6359:10)
    at file:///<path>/fresh-libsql/_fresh/server/server-entry.mjs:6361:442

I created a repository to replicate & isolate the issue: https://github.com/DontMash/fresh-libsql fresh: v2.1.4 deno: v2.5.4

Steps to reproduce:

  1. Setup a new fresh project

    deno run -Ar jsr:@fresh/init
    
  2. Add @libsql/client package

    deno add npm:@libsql/client
    
  3. Use the package to create a client

    ...
    const turso = createClient({
        url: "file:local.db",
    });
    ...
    
  4. Build the project

    deno task build
    
  5. Try running the project (will fail)

    deno task start
    

DontMash avatar Nov 02 '25 00:11 DontMash