Cannot use libsql in production

Aperta
#3,593 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
deno, typescript
Ambito
build-system

Direzione di ricerca

The failure occurs in the built _fresh/server/server-entry.mjs when it cannot resolve @libsql/darwin-arm64; the report also links a reproduction repository. Read the build and server startup paths that bundle npm dependencies, then reproduce with deno task build and deno task start. Done means the reproduced libsql client starts successfully after a production build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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
    
Lingua principale
TypeScript
Stelle
13.8k
Fork
757
Merge medio
3m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di freshframework/fresh

Tutte le issue di freshframework/fresh

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.