Comments (5)
+1 - Experiencing the same issue trying to use this Turso package in my Next.js project
from libsql.
Also experiencing this issue
from libsql.
+1
I think the regex ./node_modules/@libsql/ ./node_modules/@libsql/ sync ^\.\/.*$
is catching the .md file and trying to parse it as something that isn't markdown
from libsql.
+1, I'm on a monorepo setup with turborepo
Drizzle ORM setup with Turso in packages/db
import "dotenv/config";
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
const client = createClient({
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
});
export const db = drizzle(client);
When I import db
to page.tsx
in apps/web
, I get the error:
web:dev: Module parse failed: Unexpected token (1:0)
web:dev: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
web:dev: > <p align="center">
web:dev: | <a href="https://docs.turso.tech/sdk/ts/quickstart">
web:dev: | <img alt="Turso + TypeScript" src="https://github.com/tursodatabase/libsql-client-ts/assets/950181/5d3a2693-75f9-4c56-9107-8ccaa96785fd" width="1000">
web:dev:
web:dev: Import trace for requested module:
web:dev: ../../node_modules/.pnpm/@libsql+client@0.6.0/node_modules/@libsql/client/README.md
web:dev: ../../node_modules/.pnpm/libsql@0.3.12/node_modules/@libsql/ ../../node_modules/.pnpm/node_modules/@libsql/ ../../node_modules/@libsql/ ../../node_modules/.pnpm/node_modules/@libsql/ ../../node_modules/.pnpm/libsql@0.3.12/node_modules/@libsql/ ../../node_modules/.pnpm/node_modules/@libsql/ ../../node_modules/@libsql/ ../../node_modules/.pnpm/node_modules/@libsql/ sync ^\.\/.*$
web:dev: ../../node_modules/.pnpm/libsql@0.3.12/node_modules/libsql/index.js
web:dev: ../../node_modules/.pnpm/@libsql+client@0.6.0/node_modules/@libsql/client/lib-esm/sqlite3.js
web:dev: ../../node_modules/.pnpm/@libsql+client@0.6.0/node_modules/@libsql/client/lib-esm/node.js
web:dev: ../../packages/db/index.ts
web:dev: ./src/app/page.tsx
async function addUser () {
"use server";
await db.insert(users).values({
id: nanoid(),
name: "John Doe",
email: "[email protected]",
});
};
from libsql.
Update: I fixed it by instantiating drizzle
on the Next.js project instead of exporting the setup in packages/db
.
Before
// packages/db/index.ts
import "dotenv/config";
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
const client = createClient({
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
});
export const db = drizzle(client);
After
// packages/db/index.ts
export * as schema from './schema'
export * from 'drizzle-orm/libsql'
// apps/web/src/lib/drizzle.ts
import 'dotenv/config';
import { drizzle, schema } from '@project/db';
import { createClient } from '@libsql/client';
const client = createClient({
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
});
export const db = drizzle(client, { schema });
from libsql.
Related Issues (20)
- Bulk insertion, errors and unclear limits HOT 1
- Proposal: Adding Real-Time Feature (CDC)
- Concurrent transactions on embedded replica connections fail HOT 4
- add a version of .restore to sqld
- Insert statements within remote replica transactions fail with transaction timed-out HOT 12
- Bottomless replication requires synchronous call to S3 HOT 1
- Publish libsql-server to crates.io
- ALTER TABLE ALTER COLUMN on tables with indexes do not work
- Support Remote Connection Behind HTTP Proxy?
- Docs for `Builder` should include example on how to construct an in-memory DB
- Snapshot can be unavailable for seconds for embedded replica client
- Migration is invalid related panic HOT 1
- Running the documented Docker Compose build throws an error HOT 7
- Endpoint for listing all namespaces
- Joint row deserialization into structs HOT 1
- Sync can never finish
- migration error HOT 7
- SQLITE_ROW shouldn't be an error as per docs HOT 1
- 0.24.7 release was not completed HOT 2
- column names differ from what sqlite would produce, confusing clients.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsql.