## TL;DR

[dgraham (maintainer)]: If @planetscale/database fails to import under Jest with "unexpected token" parse errors, upgrade to the 1.9.0 release or newer: it ships a CommonJS build that Jest can parse.

## Steps

1. [dgraham (maintainer)]: If @planetscale/database fails to import under Jest with "unexpected token" parse errors, upgrade to the 1.9.0 release or newer: it ships a CommonJS build that Jest can parse.

## When to use

You are seeing this: Reported in PlanetScale: Doesn't work with Jest. Use this skill when you run into "Doesn't work with Jest".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 1.9.0. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
