flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.18k stars 90 forks source link

SyntaxError: Cannot use import statement outside a module #290

Closed trevorpfiz closed 5 months ago

trevorpfiz commented 5 months ago

I am trying to run React Native Expo unit tests following this repo react-native-template-obytes. It is specifically the superjson package that is causing problems.

image

trevorpfiz commented 5 months ago

adding |superjson to transformIgnorePatterns: [ node_modules/(?!(?:.pnpm/)?((jest-)?react-native|@react-native(-community)?|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|superjson)), ], seems to fix the error?