Open
Description
I'm trying to explore using LiveStore in a RedwoodSDK project. I followed the LiveStore documentation getting started (into an existing project) on top of a fresh install of the minimal rwsdk starter.
I'm encountering these similar errors:
[ERROR] No matching export in
"node_modules/@livestore/adapter-web/dist/web-worker/shared-worker/make-shared-worker.js?sharedworker"
for import "default"
[ERROR] No matching export in
"src/livestore/livestore.worker.ts?worker" for import "default"
I've made a simple Provider component to wrap my app in:
"use client"
import { makePersistedAdapter } from "@livestore/adapter-web"
import LiveStoreSharedWorker from "@livestore/adapter-web/shared-worker?sharedworker"
import { LiveStoreProvider } from "@livestore/react"
import type React from "react"
import { unstable_batchedUpdates as batchUpdates } from "react-dom"
import type { LayoutProps } from "rwsdk/router"
import LiveStoreWorker from "@/livestore/livestore.worker?worker"
import { schema } from "@/livestore/schema.js"
import { getStoreId } from "@/app/util/store-id.js"
const storeId = getStoreId()
const adapter = makePersistedAdapter({
storage: { type: "opfs" },
worker: LiveStoreWorker,
sharedWorker: LiveStoreSharedWorker,
})
export const DemoLiveStore: React.FC = ({ children }: LayoutProps) => (
<LiveStoreProvider
schema={schema}
adapter={adapter}
renderLoading={(_) => <div>Loading LiveStore ({_.stage})...</div>}
batchUpdates={batchUpdates}
storeId={storeId}
syncPayload={{ authToken: "insecure-token-change-me" }}
>
{children}
</LiveStoreProvider>
)
I'm not really sure how the ?sharedworker
and ?worker
works. Using the livestore example repo this works fine, only when I try to set everything up manually inside a rwsdk project does this not work.
I have a repo showing what I've done so far: https://github.com/jonotron/rw-ls-demo
Metadata
Metadata
Assignees
Labels
No labels