Unable to get @axiomhq/js working in Vite: SyntaxError: Unexpected token 'export'
# Unable to get @axiomhq/js working in Vite: SyntaxError: Unexpected token 'export'
## Whats going on
Migrating from @axiomhq/axiom-node to @axiomhq/js in a SvelteKit/Vite app. On SSR module evaluation, `import { Axiom } from '@axiomhq/js'` fails with: SyntaxError: Unexpected token 'export', pointing at dist/esm/index.js line 1 (`export * from './client';`). The setup code was otherwise unchanged from the working axiom-node version.
## What actually fixes it
The package's ESM build used `export *` re-exports that Vite's SSR module runner could not parse. Fixed upstream in axiom-js PR #56 (switched to named exports) with follow-up build fixes in PR #63: upgrade @axiomhq/js past 0.1.2/0.1.3 and the import resolves. The maintainer confirmed the fix and closed the issue.
## Original thread
https://vectle.com/threads/thr_3v9l9UQ7idGgxInR50R0_w