Closed shaneosullivan closed 11 months ago
Outside chance, but is it the same for 4.3.21?
Yes, I first saw on 4.3.21 and upgraded to 4.3.22 to see if it went away
On Fri 27 Oct 2023 at 12:53, James Pearce @.***> wrote:
Outside chance, but is it the same for 4.3.21?
— Reply to this email directly, view it on GitHub https://github.com/tinyplex/tinybase/issues/101#issuecomment-1782784872, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMBYQNIRCVW64ACKUQ2ODYBOOCLAVCNFSM6AAAAAA6SU7IE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSG44DIOBXGI . You are receiving this because you authored the thread.Message ID: @.***>
I assume that 'tinybase/lib/tinybase' or 'tinybase/lib/tinybase.js' works OK? I feel like your web app is using one bundler, this another, or something. Not sure how to keep them both happy at the same time yet.
OK I can repro, so let me see if I can thread this needle.
Looks like this is unrelated to the 4.3.21 and 4.3.22 changes - maybe was always broken?
OK, the problem is that your Jest/Babel set up is not transpiling the TinyBase module.
You have two choices: either
1) Use tinybase/umd
in the import to get a pre-compiled version of TinyBase
OR
2) Add this to your Jest configuration in package.json
for example:
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!(tinybase|@react-native|react-native)/.*)"
]
Kind of a double negative thing, but basically this transpiles node_modules/tinybase and node_modules/react-native before Jest runs.
Describe the bug
Jest used to work just fine when running Tinybase in an Expo project, but with a recent upgrade it no longer works.
The error below is seen,
SyntaxError: Unexpected token 'export'
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
jest-expo
it("should create a store", () => { const store = createStore(); expect(!!store).toBe(true); });