Closed shaneosullivan closed 11 months ago
That error message suggests there is a main
field in the TinyBase package.json, but... there is not :/
Yes, hence my confusion :-)
On Sun 22 Oct 2023 at 14:14, James Pearce @.***> wrote:
That error message suggests there is a main field in the TinyBase package.json, but... there is not :/
— Reply to this email directly, view it on GitHub https://github.com/tinyplex/tinybase/issues/100#issuecomment-1774092839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMBYU7VCOWAD4S5QV3I5LYAUL4FAVCNFSM6AAAAAA6KZ2XRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUGA4TEOBTHE . You are receiving this because you authored the thread.Message ID: @.***>
I find that npm run web
works fine. Does it for you? I guess that's webpack maybe.
But I can repro when I enable metro for web in the app.json. BRB.
Try adding "main": "./lib/tinybase.js"
to the top of the package.json
in node_modules/tinybase
... does that work for you?
Well I'm assuming it does. So I rolled a new release v4.3.20 with that fix in. Please try it out!
This broke some other resolution use-cases, so rolled v4.3.21 to hopefully get the best of both worlds.
Describe the bug
Using ExpoSqlitePersister works fine at runtime in the iOS Simulator. However when exporting to web using
the following error is seen
Note that the Tinybase code is imported as follows:
and that if the persister is not imported, then the
npx expo export -p web
command runs correctly.Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
In an Expo app, create a standalone file, e.g.
db.ts
.At the top of the file add
Now try to run the CLI command
Note that it fails.
Remove the second import, and run the CLI command again. Note that it succeeds
Expected behavior
I expected the web export to succeed, but instead it fails.
Screenshots or Videos
No response
Platform
Additional context
No response