Skip to content

"Only one source is allowed in the from clause" but not realy my code #873

@jpcastro4

Description

@jpcastro4

Describe the bug
I`m trying a query but not success

To Reproduce

import { createCollection, localStorageCollectionOptions } from '@tanstack/react-db';

const TICKETS_COLLECTION_STORAGE_KEY = 'tickets-collection';

export const getTicketKey = ticket => ticket?.id;

export const ticketsCollection = createCollection(
localStorageCollectionOptions({
id: 'conversations',
storageKey: TICKETS_COLLECTION_STORAGE_KEY,
getKey: getTicketKey,
}),
);

in my component

const ticketsQuery = useLiveQuery(q => q.from("conversations").orderBy("updatedAt", "desc"));

but error

QueryBuilderError: Only one source is allowed in the from clause

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions