SyntaxError: Unexpected token 'export'
I am running:
- [email protected]
- [email protected]
- @powersync/[email protected]
- @powersync/[email protected]
- @powersync/[email protected]
I get SyntaxError: Unexpected token 'export' when I run import { usePowerSync } from '@powersync/react';
The error message says the error is located in powersync/react/lib/index.js.
I have added 'use client'; at the top of all the files that deal with powersync.
Any idea what is going on? Is this an incompatibility with the version of React or Nextjs I have installed?
Hey @mednche can you share a little more information on how you're compiling the app? Are you using Turbopack for Next.js application?
Hi @michaelbarnes, no I am not using Turbopack. Are there some known incompatibilities with Turbopack? What sort of information would you like me to share about how I'm compiling the app?
@michaelbarnes, any idea what the Unexpected token 'export' means?
- I use javascript rather than typescript in my project. Could this be related at all?
- Could it be a clash in Node version between my app and the powersync/react lib? I use Node v20.15.1.
Any suggestions welcome as I have been stuck on this for 2 weeks now...