You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a full-stack project that will both contain the DB itself and the front-end with a back-office and a client-facing web-app. I thought trying to use libsql for this would be appropriate.
I tried to get started using StackBlitz's Bolt platform to generate a Next.js project but quickly ran into this error:
Module not found: Can't resolve './'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/@libsql/client/node_modules/@libsql/libsql-wasm-experimental/node.mjs
./node_modules/@libsql/client/lib-esm/wasm.js
./lib/db.ts
./app/page.tsx
In db.ts I create a file database using @libsql/client and in app/page.tsx I call the db to retrieve resources to render. Here is a light reproduction → from the Next.js starter on StackBlitz.
I tried to fix it by using an in-memory db or importing from @libsql/client-wasm to no avail. Then, I started from scratch, saw that this libsql demo on StackBlitz → is working and tried to build from there.
What I can't understand is where the db file is stored? Trying to initialize the client with a local file works outside of Wasm but on StackBlitz it always fails with this error: (StackBlitz →)
Error: SQLITE_CANTOPEN: sqlite3 result code 14: unable to open database file
at async ModuleLoader.import (https://nodezjhahv-rpb4.w-credentialless-staticblitz.com/builtins.ddb8d84d.js:154:2688)
at async loadESM (https://nodezjhahv-rpb4.w-credentialless-staticblitz.com/builtins.ddb8d84d.js:184:541)
at async handleMainPromise (https://nodezjhahv-rpb4.w-credentialless-staticblitz.com/builtins.ddb8d84d.js:165:296) {
resultCode: 14,
name: 'SQLite3Error'
}
I feel like these are two intertwined issues as they involve the way the package works with Wasm environments.
Hello,
I'm trying to create a full-stack project that will both contain the DB itself and the front-end with a back-office and a client-facing web-app. I thought trying to use libsql for this would be appropriate.
I tried to get started using StackBlitz's Bolt platform to generate a Next.js project but quickly ran into this error:
In
db.ts
I create a file database using@libsql/client
and inapp/page.tsx
I call the db to retrieve resources to render. Here is a light reproduction → from the Next.js starter on StackBlitz.I tried to fix it by using an in-memory db or importing from
@libsql/client-wasm
to no avail. Then, I started from scratch, saw that this libsql demo on StackBlitz → is working and tried to build from there.What I can't understand is where the db file is stored? Trying to initialize the client with a local file works outside of Wasm but on StackBlitz it always fails with this error: (StackBlitz →)
I feel like these are two intertwined issues as they involve the way the package works with Wasm environments.
Possibly related issues:
Environment
@libsql/client
: 0.14.0 (@libsql/client-wasm
)next
: 13.5.1node
: v18.20.3Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: