Paul
Paul
Explore posts from servers
SSolidJS
Created by Paul on 5/14/2025 in #support
Confused about context.
No poc, as there's too much code. Here's the dir of the component: https://github.com/paulm17/mantinesolid/tree/main/packages/%40mantine/core/src/component/Checkbox Here's the component in action:
https://mantine.dev/core/checkbox/#checkboxcard-component It's the one below the text:
You can use Checkbox.Card with Checkbox.Group the same way as Checkbox component:
Here is the context provider: https://github.com/paulm17/mantinesolid/blob/main/packages/%40mantine/core/src/component/Checkbox/CheckboxGroup/CheckboxGroup.tsx#L81 Here is the card onclick event: https://github.com/paulm17/mantinesolid/blob/main/packages/%40mantine/core/src/component/Checkbox/CheckboxCard/CheckboxCard.tsx#L130 All I can get is the onclick event and then nothing. What is annoying 😅 Checkbox Indicator on it's own - Works CheckboxCard and/or CheckboxIndicator - Works CheckboxGroup + CheckboxCard + Checkbox Indicator - Does not work uncontrolled/controlled
97 replies
SSolidJS
Created by Paul on 5/12/2025 in #support
Not understanding signals
I have this component:
const [opened, setOpened] = createSignal(false);

createEffect(() => {
console.log('parent opened: ', opened());
});

return (<>
<div style={{ 'padding': '40px' }}>
<Burger opened={opened()} onClick={() => setOpened((o) => !o)} size={400} lineSize={1} />
</div>
</>)
const [opened, setOpened] = createSignal(false);

createEffect(() => {
console.log('parent opened: ', opened());
});

return (<>
<div style={{ 'padding': '40px' }}>
<Burger opened={opened()} onClick={() => setOpened((o) => !o)} size={400} lineSize={1} />
</div>
</>)
See parent opened being reactive just fine. 😄
export const Burger = factory<BurgerFactory>((_props, ref) => {
const props = useProps('Burger', defaultProps, _props);
const [local, others] = splitProps(props, [
...
'opened',
...
]);

If I put a createEffect here. I don't see anything at all.

createEffect(() => {
console.log('opened', local.opened()); <-- have tried many combinations here
});

return (
...
<Box mod={['reduce-motion', { opened: () => local.opened! }]} {...getStyles('burger')} />
{local.children}
...
);
});
export const Burger = factory<BurgerFactory>((_props, ref) => {
const props = useProps('Burger', defaultProps, _props);
const [local, others] = splitProps(props, [
...
'opened',
...
]);

If I put a createEffect here. I don't see anything at all.

createEffect(() => {
console.log('opened', local.opened()); <-- have tried many combinations here
});

return (
...
<Box mod={['reduce-motion', { opened: () => local.opened! }]} {...getStyles('burger')} />
{local.children}
...
);
});
Note for opened: () => local.opened!
opened: local.opened
opened: local.opened()
opened: () => local.opened
opened: () => local.opened!
opened: local.opened
opened: local.opened()
opened: () => local.opened
opened: () => local.opened!
Whatever I try. I just don't get any feedback. What am I missing? The docs are a little too basic. I understand signals when all the code is centred within 1 component. Now a nested setup. I am lost. Thanks! And please ELI5 it for me 😂
14 replies
SSolidJS
Created by Paul on 5/10/2025 in #support
React vs Solid wrt contexts
Lets say I have a component.
const Foo = (.....
<component Provider>
<component />
</component Provider>
);

Foo.Bar = BarComponent.
const Foo = (.....
<component Provider>
<component />
</component Provider>
);

Foo.Bar = BarComponent.
In BarComponent I have
const ctx = useFooContext();
const ctx = useFooContext();
The problem here. Is that react follows a top to bottom strategy and will render out the components following the hierarchy. So FooProvider gets run first and the context is available.
Whereas with Solid, the BarComponent is then run first and then finds the context to be empty. Is there any way to work around this? I either want the BarComponent not be run:
Foo.Bar = BarComponent.
Foo.Bar = BarComponent.
Or to delay it until the context is available. Are there any solutions here? Thanks
13 replies
SSolidJS
Created by Paul on 5/10/2025 in #support
Determine component type
With react it's possible to tag a component with a type:
<Card withBorder>
<Card.Section inheritPadding py="md" withBorder>
Card section 1
</Card.Section>
...
</Card>
<Card withBorder>
<Card.Section inheritPadding py="md" withBorder>
Card section 1
</Card.Section>
...
</Card>
In the card component:
Card.Section = CardSection;
Card.Section = CardSection;
Now I can find that Card.Section, again in card component:
if (typeof child === 'object' && child && 'type' in child && child.type === CardSection) {
if (typeof child === 'object' && child && 'type' in child && child.type === CardSection) {
Unfortunately, it doesn't seem possible with solidjs. What I have done to determine whether a component is a Card.Section. Within CardSection.tsx
<Box
ref={ref}
mod={[{ 'with-border': local.withBorder, 'inherit-padding': local.inheritPadding, 'card-section': true }, local.mod]}
<Box
ref={ref}
mod={[{ 'with-border': local.withBorder, 'inherit-padding': local.inheritPadding, 'card-section': true }, local.mod]}
I'm setting: 'card-section': true Then to find it:
if ((item as any)?.dataset?.cardSection === 'true') {
if ((item as any)?.dataset?.cardSection === 'true') {
But is there a more idiomatic way?
16 replies
SSolidJS
Created by Paul on 5/10/2025 in #support
Default behaviour to have undefined in children?
No description
23 replies
SSolidJS
Created by Paul on 5/8/2025 in #support
Learning solid and need some understanding
Hey all. I have created a sandbox here: https://playground.solidjs.com/anonymous/797a7004-7703-4e4c-a72d-cef2e4baae26 The react for reference: https://playcode.io/2374626 The result of the toggle, is that a div should expand and then contract. But instead showing and then hiding. 😩 It's originally react code and moved to solidjs. Here's my confusion: There are a lot of yellow underlines with the warning:
The reactive variable 'local.duration' should be used within JSX, a tracked scope (like createEffect), or inside an event handler function, or else changes will be ignored.
eslint(solid/reactivity)
The reactive variable 'local.duration' should be used within JSX, a tracked scope (like createEffect), or inside an event handler function, or else changes will be ignored.
eslint(solid/reactivity)
A lot of the props are going to be static. Hence I'm only tracking mounted and following on from that transitionStatus works as well. So I don't understand the warning. Can anyone provide some clarity! Thanks!
10 replies
CCConvex Community
Created by Paul on 2/26/2025 in #support-community
watching a custom endpoint, rather than an api endpoint
I have a pretty complex endpoint in prisma. It's almost 500 lines of code and multiple queries. Is the standard practice to just dump this code into a file with all the other queries/mutations within the convex folder? Or is it possible to have some organisation and watch an endpoint instead? Thanks
38 replies
CCConvex Community
Created by Paul on 2/25/2025 in #support-community
Need some suggestions about the DX
I'm probably in the minority here. But the DX for convex isn't awesome for bigger projects.
I'm coming from prisma and being able to do something like:
await prisma.damFile.update({
where: {
id: fileId,
},
data: {
metaData: JSON.stringify(tags),
},
});
await prisma.damFile.update({
where: {
id: fileId,
},
data: {
metaData: JSON.stringify(tags),
},
});
Anywhere in my codebase, for any table, with any filtering and any data and any methods is just liberating. I also don't need to think about any centralisation. Compared to convex when I do have to think about this stuff.
And when I have encore, restate, rust, and a monorepo with multiple packages and domains all needing their own data accessibility. Now needing a centralised base. And with a codebase that's going to grow significantly bigger (when I get this poc done). I'm starting to grumble. 😩 Unfortunately I couldn't get convex-ents to work. But now it's in maintenance mode so that's moot. https://discord.com/channels/1019350475847499849/1230233206893314111/1230233206893314111 Is there anything that's coming down the pike that is a departure from the status quo? I love Convex due to it being rust and fitting nicely into my stack. But now I'm struggling due to the DX and getting it to fit in my codebase. Any thoughts welcome! 😄 Thanks!
6 replies
CCConvex Community
Created by Paul on 2/24/2025 in #support-community
How to have multiple schemas
No description
14 replies
CCConvex Community
Created by Paul on 2/12/2025 in #support-community
Could not find public function
No description
11 replies
CCConvex Community
Created by Paul on 1/20/2025 in #support-community
Can't build source using a mac
mac 15.2 node 18.10 npm: 8.19.2 latest rust latest pnpm instructions:
1) git clone https://github.com/get-convex/convex-backend
2) npm clean-install --prefix scripts
3) run cargo run -p local_backend --bin convex-local-backend
1) git clone https://github.com/get-convex/convex-backend
2) npm clean-install --prefix scripts
3) run cargo run -p local_backend --bin convex-local-backend
Getting:
error: failed to run custom build command for `isolate v0.1.0 (/Users/paul/development/src/github/convex-backend/crates/isolate)`

Caused by:
process didn't exit successfully: `/Users/paul/development/src/github/convex-backend/target/debug/build/isolate-d9f57c602cb54e55/build-script-build` (exit status: 1)
error: failed to run custom build command for `isolate v0.1.0 (/Users/paul/development/src/github/convex-backend/crates/isolate)`

Caused by:
process didn't exit successfully: `/Users/paul/development/src/github/convex-backend/target/debug/build/isolate-d9f57c602cb54e55/build-script-build` (exit status: 1)
Similar to: https://github.com/get-convex/convex-backend/issues/7 but that is windows machine.
58 replies
HHono
Created by Paul on 1/11/2025 in #help
Can't integrate hono with tus server
Anyone here used Tus: @tus/server I'm having difficulty using hono with it. Here are the different examples of using it with other providers: https://github.com/tus/tus-node-server/tree/main/packages/server#example-integrate-tus-into-express here is what I tried:
const tusServer = new Server({
path: '/uploads',
datastore: new FileStore({
directory: '/Users/paul/development/src/github/[project]/apps/hono/tmp',
}),
});

app.all('/api/dam/uploads', (c) => {
return tusServer.handle(c.req, c.res);
})
const tusServer = new Server({
path: '/uploads',
datastore: new FileStore({
directory: '/Users/paul/development/src/github/[project]/apps/hono/tmp',
}),
});

app.all('/api/dam/uploads', (c) => {
return tusServer.handle(c.req, c.res);
})
I keep getting: TypeError: req.on is not a function (probably from the tus server)
8 replies
PPrisma
Created by Paul on 1/6/2025 in #help-and-questions
Yarn monorepo, vite, tanstack router: ERROR: Could not resolve ".prisma/client/index-browser"
Node.js v22.12.0
✘ [ERROR] Could not resolve ".prisma/client/index-browser"

../../node_modules/@prisma/client/index-browser.js:1:23:
1 │ const prisma = require('.prisma/client/index-browser')
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Yarn Plug'n'Play manifest forbids importing ".prisma" here because it's not listed as a
dependency of this package:

../../../../../../.pnp.cjs:37:31:
37 │ "packageDependencies": [\
╵ ~~

You can mark the path ".prisma/client/index-browser" as external to exclude it from the bundle,
which will remove this error and leave the unresolved path in the bundle. You can also surround
this "require" call with a try/catch block to handle this failure at run-time instead of
bundle-time.

15:44:33 [vite] (client) error while updating dependencies:
Error: Build failed with 1 error:
../../node_modules/@prisma/client/index-browser.js:1:23: ERROR: Could not resolve ".prisma/client/index-browser"
at failureErrorWithLog (/Users/paul/development/src/github/[project]/node_modules/esbuild/lib/main.js:1476:15)
at /Users/paul/development/src/github/[project]/node_modules/esbuild/lib/main.js:945:25
at /Users/paul/development/src/github/[project]/node_modules/esbuild/lib/main.js:1354:9
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Node.js v22.12.0
✘ [ERROR] Could not resolve ".prisma/client/index-browser"

../../node_modules/@prisma/client/index-browser.js:1:23:
1 │ const prisma = require('.prisma/client/index-browser')
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Yarn Plug'n'Play manifest forbids importing ".prisma" here because it's not listed as a
dependency of this package:

../../../../../../.pnp.cjs:37:31:
37 │ "packageDependencies": [\
╵ ~~

You can mark the path ".prisma/client/index-browser" as external to exclude it from the bundle,
which will remove this error and leave the unresolved path in the bundle. You can also surround
this "require" call with a try/catch block to handle this failure at run-time instead of
bundle-time.

15:44:33 [vite] (client) error while updating dependencies:
Error: Build failed with 1 error:
../../node_modules/@prisma/client/index-browser.js:1:23: ERROR: Could not resolve ".prisma/client/index-browser"
at failureErrorWithLog (/Users/paul/development/src/github/[project]/node_modules/esbuild/lib/main.js:1476:15)
at /Users/paul/development/src/github/[project]/node_modules/esbuild/lib/main.js:945:25
at /Users/paul/development/src/github/[project]/node_modules/esbuild/lib/main.js:1354:9
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Tried various things, can't get past this.
5 replies
PPrisma
Created by Paul on 1/6/2025 in #help-and-questions
Prisma schema folder
I'm running v6. Is [schema folders] still in preview. I'm getting:
Error validating field `user` in model `DamFile`: The relation field `user` on model `DamFile` is missing an opposite relation field on the model `User`. Either run `prisma format` or add it manually.Prisma
Error validating field `user` in model `DamFile`: The relation field `user` on model `DamFile` is missing an opposite relation field on the model `User`. Either run `prisma format` or add it manually.Prisma
Seems it can't detect the other tables in adjacent schema files in the same folder.
5 replies
DTDrizzle Team
Created by Paul on 1/17/2024 in #help
Retrieving ids when in a batch?
I'm doing the following with a batch. Where I am getting stuck is the very last join insert. How can I get the resulting ids from the 2 separate inserts (categoryQuery and imageQuery) ? Thanks!
const allTransactions = [] as any[];
const categoryQuery = db
.insert(schema.medusaCategories)
.values({
id: genId(),
parentId:
parsedData.parentId !== undefined ? parsedData.parentId : undefined,
name: parsedData.name,
enabled: parsedData.enabled,
description: parsedData.description,
pageTitle: parsedData.title,
metaDescription: parsedData.metaDescription,
slug: parsedData.slug,
storeId: parsedData.storeId,
})
.returning({ id: schema.medusaCategories.id });

allTransactions.push(categoryQuery);

if (parsedData.images && parsedData.images.length > 0) {
parsedData.images.forEach(async (image: any) => {
const imageQuery = db
.insert(schema.images)
.values({
id: image.id,
name: image.name,
key: image.key,
url: image.url,
size: image.size,
extension: image.extension,
hash: image.hash,
type: image.type,
})
.returning({ id: schema.images.id });

allTransactions.push(imageQuery);

// const join = db.insert(schema.medusaCategoryImages).values({
// id: genId(),
// categoryId: [categoryQuery].id,
// imageId: [imageQuery].id,
// });

// allTransactions.push(join);
});
}

const res = await db.batch(allTransactions);
const allTransactions = [] as any[];
const categoryQuery = db
.insert(schema.medusaCategories)
.values({
id: genId(),
parentId:
parsedData.parentId !== undefined ? parsedData.parentId : undefined,
name: parsedData.name,
enabled: parsedData.enabled,
description: parsedData.description,
pageTitle: parsedData.title,
metaDescription: parsedData.metaDescription,
slug: parsedData.slug,
storeId: parsedData.storeId,
})
.returning({ id: schema.medusaCategories.id });

allTransactions.push(categoryQuery);

if (parsedData.images && parsedData.images.length > 0) {
parsedData.images.forEach(async (image: any) => {
const imageQuery = db
.insert(schema.images)
.values({
id: image.id,
name: image.name,
key: image.key,
url: image.url,
size: image.size,
extension: image.extension,
hash: image.hash,
type: image.type,
})
.returning({ id: schema.images.id });

allTransactions.push(imageQuery);

// const join = db.insert(schema.medusaCategoryImages).values({
// id: genId(),
// categoryId: [categoryQuery].id,
// imageId: [imageQuery].id,
// });

// allTransactions.push(join);
});
}

const res = await db.batch(allTransactions);
2 replies
DTDrizzle Team
Created by Paul on 1/11/2024 in #help
Type issue when creating self join
I have the following:
export const medusaCategories = sqliteTable("medusa_categories", {
id: text("id").unique(),
createdAt: text("created_at")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: text("updated_at").default(sql`CURRENT_TIMESTAMP`),
deletedAt: text("deleted_at"),
// relations
storeId: text("store_id")
.references(() => medusaStores.id)
.notNull(),
parentId: text("parent_id").references(() => medusaCategories.id).notNull(),
});
export const medusaCategories = sqliteTable("medusa_categories", {
id: text("id").unique(),
createdAt: text("created_at")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: text("updated_at").default(sql`CURRENT_TIMESTAMP`),
deletedAt: text("deleted_at"),
// relations
storeId: text("store_id")
.references(() => medusaStores.id)
.notNull(),
parentId: text("parent_id").references(() => medusaCategories.id).notNull(),
});
If I comment out parentId then I get the type for medusaCategories. Otherwise I get the error: 'medusaCategories' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer How to resolve? Thanks
3 replies
DTDrizzle Team
Created by Paul on 1/6/2024 in #help
SyntaxError: Invalid or unexpected token when trying to push:
Hey all. I've just created a turso database and want to push. I'm getting the following error: SyntaxError: Invalid or unexpected token Any ideas why? Thanks
paul@Pauls-MacBook-Pro db % pnpm db:push

> @golfcart/[email protected] db:push /Users/paul/development/src/golf_cart/packages/db
> pnpm with-env drizzle-kit push:sqlite


> @golfcart/[email protected] with-env /Users/paul/development/src/golf_cart/packages/db
> dotenv -e ../../.env -- "drizzle-kit" "push:sqlite"

No config path provided, using default path
Reading config file '/Users/paul/development/src/golf_cart/packages/db/drizzle.config.ts'
drizzle-kit: v0.20.10
drizzle-orm: v0.29.3

/Users/paul/development/src/golf_cart/packages/db/src/schema/.DS_Store:1



SyntaxError: Invalid or unexpected token
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1178:20)
at Module._compile (node:internal/modules/cjs/loader:1220:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at newLoader (/Users/paul/development/src/golf_cart/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:8648:13)
at Object.newLoader (/Users/paul/development/src/golf_cart/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:8648:13)
at extensions..js (/Users/paul/development/src/golf_cart/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:11176:28)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
paul@Pauls-MacBook-Pro db % pnpm db:push

> @golfcart/[email protected] db:push /Users/paul/development/src/golf_cart/packages/db
> pnpm with-env drizzle-kit push:sqlite


> @golfcart/[email protected] with-env /Users/paul/development/src/golf_cart/packages/db
> dotenv -e ../../.env -- "drizzle-kit" "push:sqlite"

No config path provided, using default path
Reading config file '/Users/paul/development/src/golf_cart/packages/db/drizzle.config.ts'
drizzle-kit: v0.20.10
drizzle-orm: v0.29.3

/Users/paul/development/src/golf_cart/packages/db/src/schema/.DS_Store:1



SyntaxError: Invalid or unexpected token
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1178:20)
at Module._compile (node:internal/modules/cjs/loader:1220:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at newLoader (/Users/paul/development/src/golf_cart/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:8648:13)
at Object.newLoader (/Users/paul/development/src/golf_cart/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:8648:13)
at extensions..js (/Users/paul/development/src/golf_cart/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:11176:28)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
5 replies